Skip to content

Commit

Permalink
Merge pull request #277 from sinan-shaban-freestar/add-missing-oauth2…
Browse files Browse the repository at this point in the history
…ResourceOwnerCredentials-type-to-decryptedCredential

Add the OAuth2ResourceOwnerCredentials type to the AuthConfig.DecryptedCredential definition
  • Loading branch information
srinandan authored Jul 15, 2024
2 parents 6a776dd + 60a207e commit 230a081
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions internal/client/authconfigs/authconfigs.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,13 @@ type authConfigExternal struct {
}

type decryptedCredential struct {
CredentialType string `json:"credentialType,omitempty"`
UsernameAndPassword *usernameAndPassword `json:"usernameAndPassword,omitempty"`
OidcToken *oidcToken `json:"oidcToken,omitempty"`
Jwt *jwt `json:"jwt,omitempty"`
ServiceAccountCredentials *serviceAccountCredentials `json:"serviceAccountCredentials,omitempty"`
AuthToken *authToken `json:"authToken,omitempty"`
CredentialType string `json:"credentialType,omitempty"`
UsernameAndPassword *usernameAndPassword `json:"usernameAndPassword,omitempty"`
OidcToken *oidcToken `json:"oidcToken,omitempty"`
Jwt *jwt `json:"jwt,omitempty"`
ServiceAccountCredentials *serviceAccountCredentials `json:"serviceAccountCredentials,omitempty"`
AuthToken *authToken `json:"authToken,omitempty"`
OAuth2ResourceOwnerCredentials *oauth2ResourceOwnerCredentials `json:"oauth2ResourceOwnerCredentials,omitempty"`
}

type usernameAndPassword struct {
Expand Down Expand Up @@ -90,6 +91,16 @@ type authToken struct {
Token string `json:"token,omitempty"`
}

type oauth2ResourceOwnerCredentials struct {
ClientId string `json:"clientId,omitempty"`
ClientSecret string `json:"clientSecret,omitempty"`
Username string `json:"username,omitempty"`
Password string `json:"password,omitempty"`
TokenEndpoint string `json:"tokenEndpoint,omitempty"`
RequestType string `json:"requestType,omitempty"`
Scope string `json:"scope,omitempty"`
}

// Create
func Create(content []byte) (respBody []byte, err error) {
c := authConfig{}
Expand Down

0 comments on commit 230a081

Please sign in to comment.