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

APP-6997: Implement CreateOAuthApp CLI #4687

Merged
merged 10 commits into from
Jan 8, 2025

Conversation

gloriacai01
Copy link
Member

add create oauth app command to the cli. usage text screenshot:
Screenshot 2025-01-07 at 2 25 42 PM

@viambot viambot added the safe to test This pull request is marked safe to test from a trusted zone label Jan 7, 2025
cli/client.go Outdated
enabledGrants := args.EnabledGrants

clientAuthentication, err := clientAuthToProto(args.ClientAuthentication)
func createOauthAppConfig(clientAuthentication, pkce, urlValidation, logoutURI string,
Copy link
Member Author

Choose a reason for hiding this comment

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

factored this into a separate function since updateOauthApp and createOauthApp both need to create an oauthAppConfig

@gloriacai01 gloriacai01 marked this pull request as ready for review January 7, 2025 19:46
@gloriacai01 gloriacai01 requested a review from a team as a code owner January 7, 2025 19:46
Copy link
Member

@maxhorowitz maxhorowitz left a comment

Choose a reason for hiding this comment

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

All LGTM - but holding off on approve because this is SDK's domain -
Thanks for the great work !!! 👍

cli/client.go Outdated
enabledGrants := args.EnabledGrants

clientAuthentication, err := clientAuthToProto(args.ClientAuthentication)
func createOauthAppConfig(clientAuthentication, pkce, urlValidation, logoutURI string,
Copy link
Member

Choose a reason for hiding this comment

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

The term "create" almost feels overloaded here because we're using it as part of both the create/update OAuth app flows - maybe something a little more distinct so it's not confused with OAuth app creation ?

cli/app.go Outdated Show resolved Hide resolved
cli/app.go Outdated Show resolved Hide resolved
cli/app.go Outdated Show resolved Hide resolved
cli/client.go Outdated
return err
}

printf(cCtx.App.Writer, "Successfully created OAuth app %s", args.ClientName)
Copy link
Member

Choose a reason for hiding this comment

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

I want us to display the client ID and client secret that are returned in the response type.

flags[oauthAppFlagClientAuthentication] = "required"
flags[oauthAppFlagURLValidation] = "allow_wildcards"
flags[oauthAppFlagPKCE] = "not_required"
flags[oauthAppFlagOriginURIs] = []string{"https://woof.com/login", "https://arf.com/"}
Copy link
Member

Choose a reason for hiding this comment

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

🐶

Copy link
Member

@stuqdog stuqdog left a comment

Choose a reason for hiding this comment

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

I'll let @maxhorowitz speak to some of the more implementation-y details, but from a CLI perspective this lgtm!

@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Jan 8, 2025
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Jan 8, 2025
Copy link
Member

@maxhorowitz maxhorowitz left a comment

Choose a reason for hiding this comment

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

Approved assuming you commit suggestions - thanks !

gloriacai01 and others added 2 commits January 8, 2025 13:26
Co-authored-by: Max Horowitz <[email protected]>
Co-authored-by: Max Horowitz <[email protected]>
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Jan 8, 2025
Co-authored-by: Max Horowitz <[email protected]>
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Jan 8, 2025
@viambot viambot added safe to test This pull request is marked safe to test from a trusted zone and removed safe to test This pull request is marked safe to test from a trusted zone labels Jan 8, 2025
@gloriacai01 gloriacai01 merged commit 9967c1b into viamrobotics:main Jan 8, 2025
16 checks passed
@gloriacai01 gloriacai01 deleted the app-6997 branch January 8, 2025 19:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
safe to test This pull request is marked safe to test from a trusted zone
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants