document the client_id and client_secret keys in samples and error messages (#142)
This commit is contained in:
parent
2483bc1443
commit
67c8745e11
@ -11,8 +11,8 @@ metadata:
|
|||||||
namespace: custom-namespace
|
namespace: custom-namespace
|
||||||
type: Opaque
|
type: Opaque
|
||||||
data:
|
data:
|
||||||
client_id: NDI0MjQyNDI=
|
CLIENT_ID: NDI0MjQyNDI=
|
||||||
client_secret: czNjUjM3cDRzc1ZWMHJENDMyMQ==
|
CLIENT_SECRET: czNjUjM3cDRzc1ZWMHJENDMyMQ==
|
||||||
---
|
---
|
||||||
apiVersion: hydra.ory.sh/v1alpha1
|
apiVersion: hydra.ory.sh/v1alpha1
|
||||||
kind: OAuth2Client
|
kind: OAuth2Client
|
||||||
|
@ -5,8 +5,8 @@ metadata:
|
|||||||
namespace: default
|
namespace: default
|
||||||
type: Opaque
|
type: Opaque
|
||||||
data:
|
data:
|
||||||
client_id: MDA5MDA5MDA=
|
CLIENT_ID: MDA5MDA5MDA=
|
||||||
client_secret: czNjUjM3cDRzc1ZWMHJEMTIzNA==
|
CLIENT_SECRET: czNjUjM3cDRzc1ZWMHJEMTIzNA==
|
||||||
---
|
---
|
||||||
apiVersion: hydra.ory.sh/v1alpha1
|
apiVersion: hydra.ory.sh/v1alpha1
|
||||||
kind: OAuth2Client
|
kind: OAuth2Client
|
||||||
|
@ -404,12 +404,12 @@ func (r *OAuth2ClientReconciler) ensureEmptyStatusError(ctx context.Context, c *
|
|||||||
func parseSecret(secret apiv1.Secret, authMethod hydrav1alpha1.TokenEndpointAuthMethod) (*hydra.Oauth2ClientCredentials, error) {
|
func parseSecret(secret apiv1.Secret, authMethod hydrav1alpha1.TokenEndpointAuthMethod) (*hydra.Oauth2ClientCredentials, error) {
|
||||||
id, found := secret.Data[ClientIDKey]
|
id, found := secret.Data[ClientIDKey]
|
||||||
if !found {
|
if !found {
|
||||||
return nil, fmt.Errorf("client_id property missing")
|
return nil, fmt.Errorf("%s property missing", ClientIDKey)
|
||||||
}
|
}
|
||||||
|
|
||||||
psw, found := secret.Data[ClientSecretKey]
|
psw, found := secret.Data[ClientSecretKey]
|
||||||
if !found && authMethod != "none" {
|
if !found && authMethod != "none" {
|
||||||
return nil, fmt.Errorf("client_secret property missing")
|
return nil, fmt.Errorf("%s property missing", ClientSecretKey)
|
||||||
}
|
}
|
||||||
|
|
||||||
return &hydra.Oauth2ClientCredentials{
|
return &hydra.Oauth2ClientCredentials{
|
||||||
|
@ -344,7 +344,7 @@ var _ = Describe("OAuth2Client Controller", func() {
|
|||||||
Expect(err).NotTo(HaveOccurred())
|
Expect(err).NotTo(HaveOccurred())
|
||||||
Expect(retrieved.Status.ReconciliationError).NotTo(BeNil())
|
Expect(retrieved.Status.ReconciliationError).NotTo(BeNil())
|
||||||
Expect(retrieved.Status.ReconciliationError.Code).To(Equal(hydrav1alpha1.StatusInvalidSecret))
|
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
|
//delete instance
|
||||||
c.Delete(context.TODO(), instance)
|
c.Delete(context.TODO(), instance)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user