Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JWTOIDCAuthEngineRole boundClaims support for string lists values #232

Closed
Gio-R opened this issue Feb 29, 2024 · 2 comments
Closed

JWTOIDCAuthEngineRole boundClaims support for string lists values #232

Gio-R opened this issue Feb 29, 2024 · 2 comments

Comments

@Gio-R
Copy link

Gio-R commented Feb 29, 2024

As indicated here, Vault supports string lists as values for the bound_claims map. Looking at the JWTOIDCAuthEngineRole CRD description, it says that "The expected value may be a single string or a list of strings". I tried to apply this descriptor:

apiVersion: redhatcop.redhat.io/v1alpha1
kind: JWTOIDCAuthEngineRole
metadata:
  name: vault-user
  namespace: vault-configurator
spec:
  name: tool
  authentication: 
    path: kubernetes
    role: configurator
    serviceAccount:
      name: vault-configurator
  path: jwt-auth
  userClaim: sub
  tokenPolicies:
    - tool
  roleType: jwt
  boundClaims:
    "/kubernetes.io/namespace": ["namespace1", "namespace2"]
  boundClaimsType: string

but got

error: error validating "jwt_auth_role.yaml": error validating data: ValidationError(JWTOIDCAuthEngineRole.spec.boundClaims./kubernetes.io/namespace): invalid type for io.redhat.redhatcop.v1alpha1.JWTOIDCAuthEngineRole.spec.boundClaims: got "array", expected "string"; if you choose to ignore these errors, turn validation off with --validate=false

I also tried to set boundClaims to "/kubernetes.io/namespace": "[namespace1 namespace2]", but while this looked correct when looking at the Vault configuration with vault read auth/jwt-auth/role/tool it still didn't work.

Dis I miss something, or are list of strings not currently supported as values for bound claims?

@erlisb
Copy link
Contributor

erlisb commented May 24, 2024

Hi @Gio-R, I applied a fix here: #238
Please, check and let me know.

Thanks.

@Gio-R
Copy link
Author

Gio-R commented May 31, 2024

Everything seems to work, thanks!

@Gio-R Gio-R closed this as completed May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants