Skip to content

Commit ce3617b

Browse files
Rui YangCI Bot
authored andcommitted
Fix tests in TestServerSupportedGrants for client credentials
Signed-off-by: Rui Yang <[email protected]>
1 parent d15d7d5 commit ce3617b

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

server/handlers_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ func TestHandleDiscovery(t *testing.T) {
6363
Introspect: fmt.Sprintf("%s/token/introspect", httpServer.URL),
6464
GrantTypes: []string{
6565
"authorization_code",
66+
"client_credentials",
6667
"refresh_token",
6768
"urn:ietf:params:oauth:grant-type:device_code",
6869
"urn:ietf:params:oauth:grant-type:token-exchange",

server/server_test.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ func newTestServer(ctx context.Context, t *testing.T, updateConfig func(c *Confi
101101
grantTypeTokenExchange,
102102
grantTypeImplicit,
103103
grantTypePassword,
104+
grantTypeClientCredentials,
104105
},
105106
}
106107
if updateConfig != nil {
@@ -1760,7 +1761,7 @@ func TestServerSupportedGrants(t *testing.T) {
17601761
{
17611762
name: "Simple",
17621763
config: func(c *Config) {},
1763-
resGrants: []string{grantTypeAuthorizationCode, grantTypeRefreshToken, grantTypeDeviceCode, grantTypeTokenExchange},
1764+
resGrants: []string{grantTypeAuthorizationCode, grantTypeClientCredentials, grantTypeRefreshToken, grantTypeDeviceCode, grantTypeTokenExchange},
17641765
},
17651766
{
17661767
name: "Minimal",
@@ -1770,20 +1771,20 @@ func TestServerSupportedGrants(t *testing.T) {
17701771
{
17711772
name: "With password connector",
17721773
config: func(c *Config) { c.PasswordConnector = "local" },
1773-
resGrants: []string{grantTypeAuthorizationCode, grantTypePassword, grantTypeRefreshToken, grantTypeDeviceCode, grantTypeTokenExchange},
1774+
resGrants: []string{grantTypeAuthorizationCode, grantTypeClientCredentials, grantTypePassword, grantTypeRefreshToken, grantTypeDeviceCode, grantTypeTokenExchange},
17741775
},
17751776
{
17761777
name: "With token response",
17771778
config: func(c *Config) { c.SupportedResponseTypes = append(c.SupportedResponseTypes, responseTypeToken) },
1778-
resGrants: []string{grantTypeAuthorizationCode, grantTypeImplicit, grantTypeRefreshToken, grantTypeDeviceCode, grantTypeTokenExchange},
1779+
resGrants: []string{grantTypeAuthorizationCode, grantTypeClientCredentials, grantTypeImplicit, grantTypeRefreshToken, grantTypeDeviceCode, grantTypeTokenExchange},
17791780
},
17801781
{
17811782
name: "All",
17821783
config: func(c *Config) {
17831784
c.PasswordConnector = "local"
17841785
c.SupportedResponseTypes = append(c.SupportedResponseTypes, responseTypeToken)
17851786
},
1786-
resGrants: []string{grantTypeAuthorizationCode, grantTypeImplicit, grantTypePassword, grantTypeRefreshToken, grantTypeDeviceCode, grantTypeTokenExchange},
1787+
resGrants: []string{grantTypeAuthorizationCode, grantTypeClientCredentials, grantTypeImplicit, grantTypePassword, grantTypeRefreshToken, grantTypeDeviceCode, grantTypeTokenExchange},
17871788
},
17881789
}
17891790

0 commit comments

Comments
 (0)