This repository was archived by the owner on Feb 25, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6k
Allow parse_and_send to use access tokens #22019
Merged
fluttergithubbot
merged 3 commits into
flutter:master
from
liyuqian:support_access_token
Oct 29, 2020
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this needed?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically, no as we default the project id to be
flutter-cirrusif it's not provided.However, to avoid any confusion, I felt it's better to set the token and GCP project id in one place because one might need to change the token when the project is changed (or vice versa). The recipe example you gave me also set the token and the project id in one place.
I'm Ok either way. If there's a difficulty in giving the GCP project id in the environment variables, or if you'd like to omit it, I can easily remove it from this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(The current PR does require
env.containsKey(kGcpProject)to be true though. I can remove it so it's not needed.)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I advanced a little bit but the authenticated client is rejecting the token: https://chromium-swarm.appspot.com/task?id=4f8147477ee94610
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I need to add LUCI's service account to flutter-cirrus project's access list. Do you have the id of that service account, or can you put a link to your recipe so maybe I can look it up?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The service account is "flutter-try-builder@chops-service-accounts.iam.gserviceaccount.com" I tried adding it yesterday but maybe I didn't granted it the correct permissions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's strange. "Cloud Datastore User" should be the correct role... Is there someway to verify that the generated token belongs to that service account (e.g. write a script that takes an access token and use some APIs to print out the id)?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The easiest way will be to generate a token using
gcloud auth application-default print-access-tokenand passing it directly to the tool to see if the tool is processing the token in the expected way.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gcloud auth application-default print-access-tokenseems to require a credentials json of the service account to print the access token? If so, I've already done a similar test by generating the token from the credentials and send it to the script: https://github.com/flutter/engine/pull/22019/files#diff-f2e2f624ef84bb33cc75f9c5a09e1c0f9371eb06d5b73ce94fd65ca6ee052b92R40