Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions cmd/router/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ func main() {
mtlsCert = flag.String("mtls-cert", "", "Path to mTLS client certificate for upstream WorkloadManager connections")
mtlsKey = flag.String("mtls-key", "", "Path to mTLS client key for upstream WorkloadManager connections")
mtlsCA = flag.String("mtls-ca", "", "Path to mTLS CA bundle for verifying upstream WorkloadManager identity")

// OIDC configuration for external user authentication.
// External auth is automatically enabled when --oidc-issuer-url is provided.
oidcIssuerURL = flag.String("oidc-issuer-url", "", "OIDC provider issuer URL, enables external auth when set")
oidcAudience = flag.String("oidc-audience", "agentcube-api", "Expected audience (aud) claim in the access token")
oidcRolesClaim = flag.String("oidc-roles-claim", "", "JSON path to roles array in the JWT (e.g., realm_access.roles)")
oidcRequiredRole = flag.String("oidc-required-role", "", "Role required to access the API (e.g., sandbox:invoke)")
Comment on lines +50 to +53

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer update to

oidc-issuer-url -> jwt-issuer-url
oidc-roles-claim -> jwt-role-claim
oidc-required-role -> jwt-required-role, this may need to be deleted, once we support authz, we can put iy in the api

)

// Initialize klog flags
Expand Down Expand Up @@ -76,6 +83,10 @@ func main() {
TLSKey: *tlsKey,
MaxConcurrentRequests: *maxConcurrentRequests,
MTLSConfig: tlsConfig,
OIDCIssuerURL: *oidcIssuerURL,
OIDCAudience: *oidcAudience,
OIDCRolesClaim: *oidcRolesClaim,
OIDCRequiredRole: *oidcRequiredRole,
}

// Create Router API server
Expand Down
Loading
Loading