Skip to content

Commit

Permalink
comments, make method private
Browse files Browse the repository at this point in the history
  • Loading branch information
roncodingenthusiast committed Sep 13, 2023
1 parent 027730c commit 6df72e3
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions control-plane/api/v1alpha1/jwtprovider_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,7 @@ func (r *RemoteJWKS) validate(path *field.Path) field.ErrorList {
return errs
}

// JWKSCluster defines how the specified Remote JWKS URI is to be fetched.
type JWKSCluster struct {
// DiscoveryType refers to the service discovery type to use for resolving the cluster.
//
Expand Down Expand Up @@ -481,15 +482,15 @@ func (c *JWKSCluster) validate(path *field.Path) field.ErrorList {
return errs
}

errs = append(errs, c.DiscoveryType.Validate(path.Child("discoveryType"))...)
errs = append(errs, c.DiscoveryType.validate(path.Child("discoveryType"))...)
errs = append(errs, c.TLSCertificates.validate(path.Child("tlsCertificates"))...)

return errs
}

type ClusterDiscoveryType string

func (d ClusterDiscoveryType) Validate(path *field.Path) field.ErrorList {
func (d ClusterDiscoveryType) validate(path *field.Path) field.ErrorList {
var errs field.ErrorList

switch d {
Expand Down Expand Up @@ -551,6 +552,7 @@ func (c *JWKSTLSCertificate) validate(path *field.Path) field.ErrorList {
return errs
}

// JWKSTLSCertProviderInstance Certificate provider instance for fetching TLS certificates.
type JWKSTLSCertProviderInstance struct {
// InstanceName refers to the certificate provider instance name
//
Expand Down Expand Up @@ -618,6 +620,9 @@ func (c *JWKSTLSCertTrustedCA) validate(path *field.Path) field.ErrorList {
return errs
}

// JWKSRetryPolicy defines a retry policy for fetching JWKS.
//
// There is no retry by default.
type JWKSRetryPolicy struct {
// NumRetries is the number of times to retry fetching the JWKS.
// The retry strategy uses jittered exponential backoff with
Expand Down Expand Up @@ -651,6 +656,9 @@ func (j *JWKSRetryPolicy) validate(path *field.Path) field.ErrorList {
return append(errs, j.RetryPolicyBackOff.validate(path.Child("retryPolicyBackOff"))...)
}

// RetryPolicyBackOff defines retry policy backoff
//
// Defaults to Envoy's backoff policy
type RetryPolicyBackOff struct {
// BaseInterval to be used for the next back off computation
//
Expand Down

0 comments on commit 6df72e3

Please sign in to comment.