document the client_id and client_secret keys in samples and error messages (#142)

This commit is contained in:
Juan Iglesias 2024-03-21 03:03:01 -05:00 committed by GitHub
parent 2483bc1443
commit 67c8745e11
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 7 additions and 7 deletions

View File

@ -11,8 +11,8 @@ metadata:
namespace: custom-namespace
type: Opaque
data:
client_id: NDI0MjQyNDI=
client_secret: czNjUjM3cDRzc1ZWMHJENDMyMQ==
CLIENT_ID: NDI0MjQyNDI=
CLIENT_SECRET: czNjUjM3cDRzc1ZWMHJENDMyMQ==
---
apiVersion: hydra.ory.sh/v1alpha1
kind: OAuth2Client

View File

@ -5,8 +5,8 @@ metadata:
namespace: default
type: Opaque
data:
client_id: MDA5MDA5MDA=
client_secret: czNjUjM3cDRzc1ZWMHJEMTIzNA==
CLIENT_ID: MDA5MDA5MDA=
CLIENT_SECRET: czNjUjM3cDRzc1ZWMHJEMTIzNA==
---
apiVersion: hydra.ory.sh/v1alpha1
kind: OAuth2Client

View File

@ -404,12 +404,12 @@ func (r *OAuth2ClientReconciler) ensureEmptyStatusError(ctx context.Context, c *
func parseSecret(secret apiv1.Secret, authMethod hydrav1alpha1.TokenEndpointAuthMethod) (*hydra.Oauth2ClientCredentials, error) {
id, found := secret.Data[ClientIDKey]
if !found {
return nil, fmt.Errorf("client_id property missing")
return nil, fmt.Errorf("%s property missing", ClientIDKey)
}
psw, found := secret.Data[ClientSecretKey]
if !found && authMethod != "none" {
return nil, fmt.Errorf("client_secret property missing")
return nil, fmt.Errorf("%s property missing", ClientSecretKey)
}
return &hydra.Oauth2ClientCredentials{

View File

@ -344,7 +344,7 @@ var _ = Describe("OAuth2Client Controller", func() {
Expect(err).NotTo(HaveOccurred())
Expect(retrieved.Status.ReconciliationError).NotTo(BeNil())
Expect(retrieved.Status.ReconciliationError.Code).To(Equal(hydrav1alpha1.StatusInvalidSecret))
Expect(retrieved.Status.ReconciliationError.Description).To(Equal("client_secret property missing"))
Expect(retrieved.Status.ReconciliationError.Description).To(Equal("CLIENT_SECRET property missing"))
//delete instance
c.Delete(context.TODO(), instance)