Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apigee X/Hybrid: Developer creation silently fails with uppercase characters in user email address #943

Closed
mxr576 opened this issue Sep 27, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@mxr576
Copy link
Contributor

mxr576 commented Sep 27, 2023

Description

The Apigee/Drupal connection only functional properly when every Drupal user has a developer account Apigee. This is the constraint that we try to enforce since day 1 with different solutions, like developer create/update on user create/update or via the Developer sync feature.

With Apigee X/Hbyrid, the user creation is successful even if the developer creation failed with INVALID_ARGUMENT: email address has to be lowercase.

Apigee Info

Apigee X/Hybrid

Steps to Reproduce

a) Create a user with uppercase characters in their email address, like [email protected].
b) Run developer sync on a developer portal that has users with uppercase characters in their email addresses.

Actual Behavior

a) The developer creation silently fails, leads to other unexpected errors in other places because an existing Drupal user has no developer account on Apigee. With Apigee Edge Debug module enabled the following log message can be found:

POST /developers HTTP/1.1
>>>>>>>>
POST /v1/organizations/***organization***/developers HTTP/1.1
Host: apigee.googleapis.com
Content-Length: 149
X-Apigee-Edge-Api-Client-Profiler: X-Apigee-Edge-Api-Client-Profiler
Content-Type: application/json
User-Agent: Apigee Edge/3.0.2; Drupal/10.1.4 (Apigee Edge PHP Client/3.0.1; PHP/8.1.21)
Accept: application/json; charset=utf-8

{"apps":[],"attributes":[],"companies":[],"email":"[email protected]","firstName":"John","lastName":"Doe U","status":"active","userName":"JohnDoe"}

<<<<<<<<
HTTP/1.1 400 Bad Request
Vary: X-Origin, Referer, Origin,Accept-Encoding
Content-Type: application/json; charset=UTF-8
Date: Wed, 27 Sep 2023 08:55:37 GMT
Server: ESF
Cache-Control: private
X-XSS-Protection: 0
X-Frame-Options: SAMEORIGIN
X-Content-Type-Options: nosniff
Alt-Svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000
Accept-Ranges: none
Transfer-Encoding: chunked

{
    "error": {
        "code": 400,
        "message": "email address has to be lowercase",
        "status": "INVALID_ARGUMENT",
        "details": [
            {
                "@type": "type.googleapis.com\/google.rpc.RequestInfo",
                "requestId": "6705244442943647307"
            }
        ]
    }
}

b) Developer sync simply skips the user with a message: Skipping [email protected] developer. INVALID_ARGUMENT: email address has to be lowercase

Expected Behavior

a) Should fail with a field level constraint validation error (was also recommended here) as long as Apigee X/Hybrid does not support email addresses described in RFC 5321 section 2.3.11.

b) Probably works as designed, although it would better if the field level validation would fail and that would be reported instead of the API call and the report would expose the underlying error message from the API backend.

Screenshots

N/A

Notes

Version Info

Apigee Edge 3.0.2

@mxr576 mxr576 added the bug Something isn't working label Sep 27, 2023
@kedarkhaire
Copy link
Collaborator

Hi @mxr576
Closing this issue, as the fix is already merged with this PR #1050
Thanks!

@mxr576
Copy link
Contributor Author

mxr576 commented May 9, 2024

Thx, I'll double check whether the implemented solution fixes this problem when it is available as a stable tag (and I'll find some time).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants