8000 feat: add oauth2 token exchange by code-asher · Pull Request #12196 · coder/coder · GitHub
[go: up one dir, main page]

Skip to content

feat: add oauth2 token exchange #12196

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

Merged
merged 11 commits into from
Feb 20, 2024
Prev Previous commit
Next Next commit
use model struct over rbac.ResourceXX
  • Loading branch information
Emyrk authored and code-asher committed Feb 20, 2024
commit 566fe637447afcbbc48689079654f6ceb031956a
6 changes: 3 additions & 3 deletions coderd/database/dbauthz/dbauthz_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2433,7 +2433,7 @@ func (s *MethodTestSuite) TestOAuth2ProviderAppCodes() {
AppID: app.ID,
UserID: user.ID,
})
check.Args(code.ID).Asserts(rbac.ResourceOAuth2ProviderAppCodeToken.WithOwner(user.ID.String()), rbac.ActionRead).Returns(code)
check.Args(code.ID).Asserts(code, rbac.ActionRead).Returns(code)
}))
s.Run("GetOAuth2ProviderAppCodeByAppIDAndSecret", s.Subtest(func(db database.Store, check *expects) {
user := dbgen.User(s.T(), db, database.User{})
Expand All @@ -2445,7 +2445,7 @@ func (s *MethodTestSuite) TestOAuth2ProviderAppCodes() {
check.Args(database.GetOAuth2ProviderAppCodeByAppIDAndSecretParams{
AppID: app.ID,
HashedSecret: code.HashedSecret,
}).Asserts(rbac.ResourceOAuth2ProviderAppCodeToken.WithOwner(user.ID.String()), rbac.ActionRead).Returns(code)
}).Asserts(code, rbac.ActionRead).Returns(code)
}))
s.Run("InsertOAuth2ProviderAppCode", s.Subtest(func(db database.Store, check *expects) {
user := dbgen.User(s.T(), db, database.User{})
Expand All @@ -2462,7 +2462,7 @@ func (s *MethodTestSuite) TestOAuth2ProviderAppCodes() {
AppID: app.ID,
UserID: user.ID,
})
check.Args(code.ID).Asserts(rbac.ResourceOAuth2ProviderAppCodeToken.WithOwner(user.ID.String()), rbac.ActionDelete)
check.Args(code.ID).Asserts(code, rbac.ActionDelete)
}))
s.Run("DeleteOAuth2ProviderAppCodesByAppAndUserID", s.Subtest(func(db database.Store, check *expects) {
user := dbgen.User(s.T(), db, database.User{})
Expand Down
0