|
1 |
| ---- |
2 |
| -apiVersion: apiserver.config.k8s.io/v1beta1 |
3 |
| -kind: AuthenticationConfiguration |
4 |
| -jwt: |
5 |
| -- issuer: |
6 |
| - # url must be unique across all authenticators. |
7 |
| - # url must not conflict with issuer configured in --service-account-issuer. |
8 |
| - url: https://gitlab.example.com |
9 |
| - # audiences is the set of acceptable audiences the JWT must be issued to. |
10 |
| - # At least one of the entries must match the "aud" claim in presented JWTs. |
11 |
| - audiences: |
12 |
| - - gitlab_user_auth |
13 |
| - # this is required to be set to "MatchAny" when multiple audiences are specified. |
14 |
| - audienceMatchPolicy: MatchAny |
15 |
| - claimMappings: |
16 |
| - # username represents an option for the username attribute. |
17 |
| - # This is the only required attribute. |
18 |
| - username: |
19 |
| - # Same as --oidc-username-claim. Mutually exclusive with username.expression. |
20 |
| - claim: preferred_username |
21 |
| - # Same as --oidc-username-prefix. Mutually exclusive with username.expression. |
22 |
| - # if username.claim is set, username.prefix is required. |
23 |
| - # Explicitly set it to "" if no prefix is desired. |
24 |
| - prefix: "oidc:" |
25 |
| - # groups represents an option for the groups attribute. |
26 |
| - groups: |
27 |
| - # Same as --oidc-groups-claim. Mutually exclusive with groups.expression. |
28 |
| - claim: groups_direct |
29 |
| - # Same as --oidc-groups-prefix. Mutually exclusive with groups.expression. |
30 |
| - # if groups.claim is set, groups.prefix is required. |
31 |
| - # Explicitly set it to "" if no prefix is desired. |
32 |
| - prefix: "gitlab:" |
33 |
| - # uid represents an option for the uid attribute. |
34 |
| - uid: |
35 |
| - # Mutually exclusive with uid.expression. |
36 |
| - claim: preferred_username |
37 |
| -- issuer: |
38 |
| - # url must be unique across all authenticators. |
39 |
| - # url must not conflict with issuer configured in --service-account-issuer. |
40 |
| - url: https://gitlab.example.com/ |
41 |
| - # audiences is the set of acceptable audiences the JWT must be issued to. |
42 |
| - # At least one of the entries must match the "aud" claim in presented JWTs. |
43 |
| - audiences: |
44 |
| - - gitlab_ci_auth |
45 |
| - # this is required to be set to "MatchAny" when multiple audiences are specified. |
46 |
| - audienceMatchPolicy: MatchAny |
47 |
| - claimMappings: |
48 |
| - # username represents an option for the username attribute. |
49 |
| - # This is the only required attribute. |
50 |
| - username: |
51 |
| - # Same as --oidc-username-claim. Mutually exclusive with username.expression. |
52 |
| - claim: sub |
53 |
| - # Same as --oidc-username-prefix. Mutually exclusive with username.expression. |
54 |
| - # if username.claim is set, username.prefix is required. |
55 |
| - # Explicitly set it to "" if no prefix is desired. |
56 |
| - prefix: "gitlab-ci:" |
57 |
| - # groups represents an option for the groups attribute. |
58 |
| - groups: |
59 |
| - # Same as --oidc-groups-claim. Mutually exclusive with groups.expression. |
60 |
| - claim: namespace_path |
61 |
| - # Same as --oidc-groups-prefix. Mutually exclusive with groups.expression. |
62 |
| - # if groups.claim is set, groups.prefix is required. |
63 |
| - # Explicitly set it to "" if no prefix is desired. |
64 |
| - prefix: "gitlab-ci:" |
65 |
| - # uid represents an option for the uid attribute. |
66 |
| - uid: |
67 |
| - # Mutually exclusive with uid.expression. |
68 |
| - claim: sub |
69 |
| - # extra attributes to be added to the UserInfo object. Keys must be domain-prefix path and must be unique. |
70 |
| - #extra: |
71 |
| - # # key is a string to use as the extra attribute key. |
72 |
| - # # key must be a domain-prefix path (e.g. example.org/foo). All characters before the first "/" must be a valid |
73 |
| - # # subdomain as defined by RFC 1123. All characters trailing the first "/" must |
74 |
| - # # be valid HTTP Path characters as defined by RFC 3986. |
75 |
| - # # k8s.io, kubernetes.io and their subdomains are reserved for Kubernetes use and cannot be used. |
76 |
| - # # key must be lowercase and unique across all extra attributes. |
77 |
| - #- key: gitlab.haufedev.systems/namespace |
78 |
| - # valueExpression: namespace_id |
79 |
| - #- key: gitlab.haufedev.systems/project |
80 |
| - # valueExpression: project_id |
81 |
| - #- key: gitlab.haufedev.systems/triggerer |
82 |
| - # valueExpression: user_id |
83 |
| - #- key: gitlab.haufedev.systems/pipeline |
84 |
| - # valueExpression: pipeline_id |
85 |
| - #- key: gitlab.haufedev.systems/job |
86 |
| - # valueExpression: job_id |
87 |
| - #- key: gitlab.haufedev.systems/runner |
88 |
| - # valueExpression: runner_id |
89 |
| - #- key: gitlab.haufedev.systems/ref |
90 |
| - # valueExpression: ref |
91 |
| - #- key: gitlab.haufedev.systems/sha |
92 |
| - # valueExpression: sha |
| 1 | +--- |
| 2 | +apiVersion: apiserver.config.k8s.io/v1beta1 |
| 3 | +kind: AuthenticationConfiguration |
| 4 | +jwt: |
| 5 | +- issuer: |
| 6 | + url: https://gitlab.example.com |
| 7 | + audiences: |
| 8 | + - group_application_id |
| 9 | + - id_token_audience |
| 10 | + audienceMatchPolicy: MatchAny |
| 11 | + claimMappings: |
| 12 | + username: |
| 13 | + expression: 'has(claims.preferred_username) ? "gitlab:" + claims.preferred_username : "gitlab-ci:" + claims.sub' |
| 14 | + groups: |
| 15 | + expression: 'has(claims.groups_direct) ? "gitlab:" + claims.groups_direct : "gitlab-ci:" + claims.namespace_path' |
| 16 | + uid: |
| 17 | + expression: 'has(claims.preferred_username) ? "gitlab:" + claims.preferred_username : "gitlab-ci:" + claims.sub' |
0 commit comments