apigee / apigee-client-php

Client library to make API calls to Apigee Edge Management API
Apache License 2.0
27 stars 30 forks source link

User update on Apigee X not working #153

Closed giteshk closed 3 years ago

giteshk commented 3 years ago

Steps to reproduce:

Try to update First and Last Name on the user on Drupal portal

Steps to reproduce

  1. In the Admin bar, click on "People"
  2. Click to edit a user
  3. Change a field such as First name or Last Name
  4. Click "Save"

Expected: User is updated

Actual: System throws an error in the errorlog. No error is shown on the screen.

>>>>>>>>
PUT /v1/organizations/***organization***/developers/22222222-8359-49a1-b49b-d5cf959e9d83 HTTP/1.1
Host: apigee.googleapis.com
Content-Length: 371
X-Apigee-Edge-Api-Client-Profiler: X-Apigee-Edge-Api-Client-Profiler
Content-Type: application/json
User-Agent: Apigee Edge DevPortal 8.x-1.22 (Apigee Edge PHP Client 2.0.7)
Accept: application/json; charset=utf-8

{"apps":["APIM_Security_Demo_App","apim_mint_demoapp_1","app2"],"attributes":[],"companies":[],"createdAt":1623806970000,"developerId":"22222222-8359-49a1-b49b-d5cf959e9d83","email":"abcd@example.com","firstName":"abcd","lastModifiedAt":1623806970000,"lastName":"abcd","organizationName":"abcd-org1","status":"active","userName":"abcd1"}
<<<<<<<<
HTTP/1.1 400 Bad Request
Vary: X-Origin, Referer, Origin,Accept-Encoding
Content-Type: application/json; charset=UTF-8
Date: Wed, 16 Jun 2021 22:48:12 GMT
Server: ESF
Cache-Control: private
X-XSS-Protection: 0
X-Frame-Options: SAMEORIGIN
X-Content-Type-Options: nosniff
Accept-Ranges: none
Transfer-Encoding: chunked

{
    "error": {
        "code": 400,
        "message": "Developer update : resource name 22222222-8359-49a1-b49b-d5cf959e9d83 in the url doesnot match with the name abcd@example.com in the request payload",
        "status": "INVALID_ARGUMENT",
        "details": [
            {
                "@type": "type.googleapis.com\/google.rpc.PreconditionFailure",
                "violations": [
                    {
                        "type": "rest.interceptor.name_mismatch",
                        "subject": "[2002:a17:531:8141::]:4177:vobi17:9855:347726:3196811",
                        "description": "Developer update : resource name 22222222-8359-49a1-b49b-d5cf959e9d83 in the url doesnot match with the name abcd@example.com in the request payload"
                    }
                ]
            },
            {
                "@type": "type.googleapis.com\/google.rpc.RequestInfo",
                "requestId": "3243783479475234489"
            }
        ]
    }
}
Transfer statistics:

total_time: 0.918s
namelookup_time: 0s
connect_time: 0s
pretransfer_time: 0s
starttransfer_time: 0.917s
redirect_time: 0s
appconnect_time: 0s
giteshk commented 3 years ago

The backend does not accept UUID for https://cloud.google.com/apigee/docs/reference/apis/apigee/rest/v1/organizations.developers/update

cnovak commented 3 years ago

What is the error that you get when this happens on the screen? Any error in the logs? Please update description @giteshk

giteshk commented 3 years ago

@cnovak I have updated the error in the issue.

cnovak commented 3 years ago

The ability to use developerId does not work with Apigee X and hybrid runtime versions 1.5.0 and 1.5.1. The only API affected is PUT /developers. This will be fixed in upcoming versions 1.6.0 and 1.5.2. This ticket is to change the PUT /developers call so send email address instead of email so that developers are not affected by this API issue. This issue also means that for Apigee X and hybrid runtime versions 1.5.0 and 1.5.1, a call to change the developer's email address will not work. This will also be fixed in the upcoming releases. A note should be added to our known issues about this.

cnovak commented 3 years ago

This needs to be put into a release ASAP since this bug will affect Apigee X customers. @shishir-intelli can you put this issue into it's own milestone and put out a release with this fix?