FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Update validate_jwt to use new JWT header by matthewg · Pull Request #1019 · GoogleCloudPlatform/python-docs-samples · GitHub

Update validate_jwt to use new JWT header - #1019

Merged
theacodes merged 7 commits into
GoogleCloudPlatform:masterfrom
matthewg:patch-3
Jul 14, 2017
Merged

Update validate_jwt to use new JWT header#1019
theacodes merged 7 commits into
GoogleCloudPlatform:masterfrom
matthewg:patch-3

Conversation

Copy link
Copy Markdown
Contributor

No description provided.

googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jul 13, 2017
Comment thread iap/validate_jwt.py
For instance: "https://example.com:8443" or
"https://example.appspot.com" .
iap_jwt: The contents of the X-Goog-Authenticated-User-JWT header.
cloud_project_number: The project *number* for your Google Cloud project.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Oh no, project number? That's awful! Why is that needed instead of just the project ID?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

The path through Google infrastructure that leads to calling the IAP auth component doesn't propagate the project ID. We could look it up in the server, but then that'd be a latency and reliability hit on every single request. Yeah, agree that it's not the user experience we'd like to have.

Comment thread iap/validate_jwt.py Outdated
Returns:
(user_id, user_email, error_str).
"""
if not (bool(app_engine_project_id) ^ bool(compute_engine_backend_service_id)):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This is a code smell, can you maybe split this into a couple of functions like validate_iap_jwt_from_compute that call a common helper with a target_audience or alternatively have one helper method that figures out the target audience and one to validate the jwt?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Comment thread iap/validate_jwt.py Outdated
return _validate_iwp_jwt(iap_jwt, expected_audience)


def validate_iap_jwt_from_app_engine(iwp_jwt, cloud_project_number,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This says app_engine, did you mean compute_engine?

Copy link
Copy Markdown
Contributor

Copy link
Copy Markdown
Contributor Author

Travis should be happy now. I've updated the test, but you'll need to redeploy gcp-devrel-iap-reflect to pick up the new header name.

Copy link
Copy Markdown
Contributor

Will do, thanks. :)

theacodes merged commit ca516a6 into GoogleCloudPlatform:master Jul 14, 2017
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants


Back | FazBrowse Home | New Git URL