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

Various OAuth fixes #1187

Merged

Conversation

alesstimec
Copy link
Collaborator

Description

  • fixes the proxy session token verification
  • changes the format of the client credentials client id bringing it in line with juju user tags
  • various local testing fixes

Engineering checklist

Check only items that apply

  • Documentation updated
  • [*] Covered by unit tests
  • Covered by integration tests

Test instructions

Notes for code reviewers

if err != nil {
return errorFnc(err)
}

// TODO(CSS-7081): Ensure for tests that the secret key can be configured.
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you can remove this TODO now.

@@ -62,5 +56,5 @@ func ParseServiceAccountTag(tag string) (ServiceAccountTag, error) {

// IsValidServiceAccountId verifies the client id for a service account is valid according to a regex internally.
func IsValidServiceAccountId(id string) bool {
return validClientId.MatchString(id)
return names.IsValidUser(id)
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't we also enforce that the id has a domain?

Copy link
Member

@babakks babakks left a comment

Choose a reason for hiding this comment

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

Just a debug leftover.

Comment on lines 617 to 618
// TODO(CSS-7081): Ensure for tests that the secret key can be configured.
// Or configure cmd tests to use the configured secret.
Copy link
Member

Choose a reason for hiding this comment

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

I think this has already been fixed.

go.mod Outdated
@@ -329,6 +328,7 @@ require (

replace (
github.com/altoros/gosigma => github.com/juju/gosigma v0.0.0-20170523021020-a27b59fe2be9
github.com/juju/juju => ../juju
Copy link
Member

Choose a reason for hiding this comment

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

Leftover from debugging.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yes! thank you

@@ -693,7 +693,7 @@
]
},
{
"clientId": "test-client-id",
"clientId": "test-client-id@canonical.com",
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are we putting the @ here? I thought we'd append it to it internally?

Copy link
Contributor

@ale8k ale8k left a comment

Choose a reason for hiding this comment

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

lgtm but bit confused why we're making client id look like email within idp itself

@alesstimec alesstimec force-pushed the oauth-various-fixes-01 branch 2 times, most recently from a662c48 to 349d2c9 Compare April 4, 2024 13:33
- fixes the proxy session token verification
- changes the format of the client credentials client id bringing it in line with juju user tags
- various local testing fixes
@alesstimec alesstimec force-pushed the oauth-various-fixes-01 branch from d2f585b to 0028df2 Compare April 4, 2024 14:02
@alesstimec alesstimec merged commit 9a48480 into canonical:feature-oidc Apr 4, 2024
4 checks passed
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.

4 participants