document the client_id and client_secret keys in samples and error messages (#142)
This commit is contained in:
@ -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{
|
||||
|
@ -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)
|
||||
|
Reference in New Issue
Block a user