API Reference
Packagesโ
| Package | Resource types |
|---|---|
ztoperator.kartverket.no/v1alpha1 | AuthPolicy |
Package ztoperator.kartverket.no/v1alpha1โ
Resource types in this package:
AuthPolicyโ
| Field | Value |
|---|---|
| Package | ztoperator.kartverket.no/v1alpha1 |
| API version | ztoperator.kartverket.no/v1alpha1 |
| Kind | AuthPolicy |
AuthPolicy is the Schema for the authpolicies API.
| Name | Type | Description | Required |
|---|---|---|---|
| apiVersion | string | ztoperator.kartverket.no/v1alpha1 | true |
| kind | string | AuthPolicy | true |
| metadata | object | Refer to the Kubernetes API documentation for the fields of the metadata field. | true |
| spec | object | AuthPolicySpec defines the desired state of AuthPolicy. | false |
| status | object | AuthPolicyStatus defines the observed state of AuthPolicy. | false |
AuthPolicy.specโ
ParentAuthPolicySpec defines the desired state of AuthPolicy.
| Name | Type | Description | Required |
|---|---|---|---|
| enabled | boolean | Whether to enable JWT validation. | true |
| selector | object | The Selector specifies which workload the defined auth policy should be applied to. | true |
| wellKnownURI | string | WellKnownURI specifies the URi to the identity provider's discovery document (also known as well-known endpoint). | true |
| acceptedResources | []string | AcceptedResources specifies resource indicators used to request an audience limited access token following RFC8707. | false |
| allowedAudiences | []object | AllowedAudiences defines the allowed audience ( | false |
| authRules | []object | AuthRules defines rules for allowing HTTP requests based on conditions | false |
| autoLogin | object | AutoLogin specifies the required configuration needed to log in users. | false |
| baselineAuth | object | BaselineAuth defines additional JWT authentication, beyond standard JWT verification. | false |
| forwardJwt | boolean | If set to | false |
| ignoreAuthRules | []object | IgnoreAuthRules defines request matchers for HTTP requests that do not require JWT authentication. | false |
| oAuthCredentials | object | OAuthCredentials specifies a reference to a kubernetes secret in the same namespace holding OAuth credentials used for authentication. | false |
| outputClaimToHeaders | []object | OutputClaimsToHeaders specifies a list of operations to copy the claim to HTTP headers on a successfully verified token. | false |
AuthPolicy.spec.selectorโ
ParentThe Selector specifies which workload the defined auth policy should be applied to.
| Name | Type | Description | Required |
|---|---|---|---|
| matchLabels | map[string]string | One or more labels that indicate a specific set of pods/VMs | true |
AuthPolicy.spec.allowedAudiences[index]โ
ParentAllowedAudience defines an audience that is validated against the aud claim in the JWT.
An audience can be defined as a static value or retrieved from a kubernetes resource.
| Name | Type | Description | Required |
|---|---|---|---|
| value | string | Value specifies a static audience value. | false |
| valueFrom | object | ValueFrom specifies a reference to a kubernetes resource to retrieve the audience value from. | false |
AuthPolicy.spec.allowedAudiences[index].valueFromโ
ParentValueFrom specifies a reference to a kubernetes resource to retrieve the audience value from.
| Name | Type | Description | Required |
|---|---|---|---|
| configMapKeyRef | object | ConfigMapKeyRef specifies a reference to a key in a ConfigMap. | false |
| secretKeyRef | object | SecretKeyRef specifies a reference to a key in a Secret. | false |
AuthPolicy.spec.allowedAudiences[index].valueFrom.configMapKeyRefโ
ParentConfigMapKeyRef specifies a reference to a key in a ConfigMap.
| Name | Type | Description | Required |
|---|---|---|---|
| key | string | Key specifies the data entry name within the ConfigMap/Secret; must follow key naming rules. | true |
| name | string | Name specifies the name of the ConfigMap/Secret; must satisfy DNS-1123 subdomain naming. | true |
AuthPolicy.spec.allowedAudiences[index].valueFrom.secretKeyRefโ
ParentSecretKeyRef specifies a reference to a key in a Secret.
| Name | Type | Description | Required |
|---|---|---|---|
| key | string | Key specifies the data entry name within the ConfigMap/Secret; must follow key naming rules. | true |
| name | string | Name specifies the name of the ConfigMap/Secret; must satisfy DNS-1123 subdomain naming. | true |
AuthPolicy.spec.authRules[index]โ
ParentRequestAuthRule defines a rule for controlling access to HTTP requests using JWT authentication.
| Name | Type | Description | Required |
|---|---|---|---|
| paths | []string | Paths specify a set of URI paths that this rule applies to. | true |
| denyRedirect | boolean | DenyRedirect specifies whether a denied request should trigger auto-login (if configured) or not when it is denied due to missing or invalid authentication. | false |
| methods | []enum | Methods specifies HTTP methods that applies for the defined paths. | false |
| when | []object | When defines additional conditions based on JWT claims that must be met. | false |
AuthPolicy.spec.authRules[index].when[index]โ
ParentCondition represents a rule that evaluates JWT claims to determine access control.
This type allows defining conditions that check whether a specific claim in the JWT token contains one of the expected values.
If multiple conditions are specified, all must be met (AND logic) for the request to be allowed.
| Name | Type | Description | Required |
|---|---|---|---|
| claim | string | Claim specifies the name of the JWT claim to check. | true |
| values | []string | Values specifies a list of allowed values for the claim. | true |
AuthPolicy.spec.autoLoginโ
ParentAutoLogin specifies the required configuration needed to log in users.
| Name | Type | Description | Required |
|---|---|---|---|
| enabled | boolean | Whether to enable auto login. | true |
| scopes | []string | Scopes specifies the OAuth2 scopes used during authorization code flow. | true |
| loginParams | map[string]string | LoginParams specifies a map of query parameters and their values which will be added in the authorize request made towards the configured identity provider. | false |
| loginPath | string | LoginPath specifies a single path that triggers auto-login behavior. | false |
| logoutPath | string | LogoutPath specifies which URI to redirect the user to when signing out. | false |
| postLogoutRedirectUri | string | PostLogoutRedirectURI specifies which URI to redirect the user to after | false |
| redirectPath | string | RedirectPath specifies which path to redirect the user to after completing the OIDC flow. | false |
AuthPolicy.spec.baselineAuthโ
ParentBaselineAuth defines additional JWT authentication, beyond standard JWT verification. Baseline authentication applies to all combinations of paths and methods not explicitly ignored by .ignoreAuthRules.
| Name | Type | Description | Required |
|---|---|---|---|
| claims | []object | Claims defines conditions based on JWT claims that must be met. | true |
AuthPolicy.spec.baselineAuth.claims[index]โ
ParentCondition represents a rule that evaluates JWT claims to determine access control.
This type allows defining conditions that check whether a specific claim in the JWT token contains one of the expected values.
If multiple conditions are specified, all must be met (AND logic) for the request to be allowed.
| Name | Type | Description | Required |
|---|---|---|---|
| claim | string | Claim specifies the name of the JWT claim to check. | true |
| values | []string | Values specifies a list of allowed values for the claim. | true |
AuthPolicy.spec.ignoreAuthRules[index]โ
ParentRequestMatcher defines paths and methods to match incoming HTTP requests.
| Name | Type | Description | Required |
|---|---|---|---|
| paths | []string | Paths specify a set of URI paths that this rule applies to. | true |
| methods | []enum | Methods specifies HTTP methods that applies for the defined paths. | false |
AuthPolicy.spec.oAuthCredentialsโ
ParentOAuthCredentials specifies a reference to a kubernetes secret in the same namespace holding OAuth credentials used for authentication.
| Name | Type | Description | Required |
|---|---|---|---|
| clientIDKey | string | ClientIDKey specifies the data key to access the client ID. | true |
| clientSecretKey | string | ClientSecretKey specifies the data key to access the client secret. | true |
| secretRef | string | SecretRef specifies the name of the kubernetes secret. | true |
AuthPolicy.spec.outputClaimToHeaders[index]โ
ParentClaimToHeader specifies a list of operations to copy the claim to HTTP headers on a successfully verified token. The header specified in each operation in the list must be unique. Nested claims of type string/int/bool is supported as well.
| Name | Type | Description | Required |
|---|---|---|---|
| claim | string | Claim specifies the name of the claim in the JWT token that will be copied to the header. | true |
| header | string | Header specifies the name of the HTTP header to which the claim value will be copied. | true |
AuthPolicy.statusโ
ParentAuthPolicyStatus defines the observed state of AuthPolicy.
| Name | Type | Description | Required |
|---|---|---|---|
| ready | boolean | true | |
| conditions | []object | false | |
| message | string | false | |
| observedGeneration | integer | Format: int64 | false |
| phase | string | false |
AuthPolicy.status.conditions[index]โ
ParentCondition contains details for one aspect of the current state of this API Resource.
| Name | Type | Description | Required |
|---|---|---|---|
| lastTransitionTime | string | lastTransitionTime is the last time the condition transitioned from one status to another. Format: date-time | true |
| message | string | message is a human readable message indicating details about the transition. | true |
| reason | string | reason contains a programmatic identifier indicating the reason for the condition's last transition. | true |
| status | enum | status of the condition, one of True, False, Unknown. Enum: True, False, Unknown | true |
| type | string | type of condition in CamelCase or in foo.example.com/CamelCase. | true |
| observedGeneration | integer | observedGeneration represents the .metadata.generation that the condition was set based upon. Format: int64 | false |