GitLab Delegated Joining (#22705)

* Add type for GitLab ProvisionToken

* Add default behaviour for domain

* Add IDTokenClaims for GitLab

* Add gitlab token source and token validator

* Thread GitLab support through auth and tbot packages

* Adjust cluster name fetching in token validator

* Initialize GitLab token validator in auth

* Improve comment on `sub`

* Working GitLab CI delegated joining

* Add additional token rule fields

* Add checking for new configuration fields

* add additional test cases for validation of gitlab config struct

* Add TestAuth_RegisterUsingToken_GitLab

* Add tests for IDTokenSource

* Fix imports

* Add tests for GitLab Token Validator

* Fix some comments that were incomplete

* Add license headers
This commit is contained in:
Noah Stride
2023-03-16 16:19:11 +00:00
committed by GitHub
parent 81f319d3e3
commit acb255cd88
20 changed files with 3619 additions and 1578 deletions
+7
View File
@@ -125,6 +125,12 @@ func (a *Server) RegisterUsingToken(ctx context.Context, req *types.RegisterUsin
return nil, trace.Wrap(err)
}
joinAttributeSrc = claims
case types.JoinMethodGitLab:
claims, err := a.checkGitLabJoinRequest(ctx, req)
if err != nil {
return nil, trace.Wrap(err)
}
joinAttributeSrc = claims
case types.JoinMethodCircleCI:
claims, err := a.checkCircleCIJoinRequest(ctx, req)
if err != nil {
@@ -189,6 +195,7 @@ func (a *Server) generateCertsBot(
renewable = true
case types.JoinMethodIAM,
types.JoinMethodGitHub,
types.JoinMethodGitLab,
types.JoinMethodCircleCI,
types.JoinMethodKubernetes,
types.JoinMethodAzure: