# SSO-templated SSH role. The OS login is derived from the user's IdP
# claim, so one role can serve a whole engineering group.
apiVersion: almaforge.com/v1
kind: Role
metadata:
  name: ssh-engineer
spec:
  options:
    maxSessionTTL: 8h # Maximum credential lifetime. Use disconnectExpiredCert to end active sessions at expiry.
  allow:
    serverLabels:
      env: ['dev', 'staging'] # Match dev or staging hosts only. Production stays out of this role.
    serverLogins:
      # Use the preferred_username claim supplied by the OIDC provider.
      - '{{external.preferred_username}}'
