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

feat: add ExecutableSource credentials #525

Merged
merged 15 commits into from
Apr 24, 2024
Merged

Conversation

bshaffer
Copy link
Contributor

@bshaffer bshaffer commented Jan 18, 2024

addresses #523

@bshaffer bshaffer marked this pull request as ready for review April 15, 2024 23:07
@bshaffer bshaffer requested a review from a team as a code owner April 15, 2024 23:07
@bshaffer bshaffer force-pushed the add-executable-credentialsource branch from 46fca69 to 024c8ce Compare April 16, 2024 17:16
@bshaffer
Copy link
Contributor Author

@aeitzman

) {
$json = json_decode($outputFileContents, true);
if (isset($json['expiration_time']) && time() < $json['expiration_time']) {
return $this->parseTokenFromResponse($outputFileContents);

Choose a reason for hiding this comment

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

nit: If there is an error here, the messages won't specify that it comes from reading an output file vs running the executable directly right? Might be helpful to differentiate that for the user.

Choose a reason for hiding this comment

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

Also, if the file response is valid Json but unsuccessful what happens here? In that case we want to re-run the executable.

Copy link
Contributor Author

@bshaffer bshaffer Apr 17, 2024

Choose a reason for hiding this comment

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

If there is an error here, the messages won't specify that it comes from reading an output file vs running the executable directly right?

That's correct. It should be easy to add that

if the file response is valid Json but unsuccessful what happens here?

Good question, I believe it throws an error same as if it's the response. Are you suggesting that if the file JSON contains success: false, we should silently retry the executable?

Is there a good document that lists the expected logic for the outputFile, because it's not very intuitive. I followed the NodeJS implementation, although I may have missed some things.

Choose a reason for hiding this comment

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

go/pluggable-auth-design but it doesn't look like that has a great flow diagram. But yes, the expected behavior is that if the output file is parseable (I.e. good JSON) but success:false, then we would re-run the executable instead of just returning the error again

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have manually run the tests in go/pluggable-auth-sdk-testing and they are now passing

src/ExecutableHandler/ExecutableHandler.php Outdated Show resolved Hide resolved
src/ExecutableHandler/ExecutableHandler.php Show resolved Hide resolved
bshaffer and others added 3 commits April 17, 2024 10:09
Co-authored-by: aeitzman <12433791+aeitzman@users.noreply.github.com>
…is/google-auth-library-php into add-executable-credentialsource
Copy link
Contributor

@yash30201 yash30201 left a comment

Choose a reason for hiding this comment

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

The PR looks good to me from PHP side, just a small nit regarding the tests : )

Great work @bshaffer!

@bshaffer bshaffer merged commit d98900d into main Apr 24, 2024
12 checks passed
@bshaffer bshaffer deleted the add-executable-credentialsource branch April 24, 2024 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants