claim

package
v1.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 27, 2026 License: Apache-2.0 Imports: 4 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	// NgcOrgClaimTypePrefix is the prefix for access claim that contains NGC organization name
	// e.g. Staging: "group/ngc-stg", Production: "group/ngc"
	NgcOrgClaimTypePrefix = "group/ngc"
	// NgcAudience describes the audience value present in NGC tokens
	NgcAudience = "ngc"

	// SsaScopeKas is the scope required to access KAS
	SsaScopeKas = "kas"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type KeycloakClaims

type KeycloakClaims struct {
	Email       string      `json:"email"`
	FirstName   string      `json:"given_name"`
	LastName    string      `json:"family_name"`
	RealmAccess RealmAccess `json:"realm_access"`
	ClientId    string      `json:"client_id"`
	Oidc_Id     string      `json:"oidc_id"`
	jwt.RegisteredClaims
}

KeycloakClaims represents the structure of Keycloak JWT claims

func (*KeycloakClaims) GetClientId

func (k *KeycloakClaims) GetClientId() string

GetClientId returns the client_id from KeycloakClaims

func (*KeycloakClaims) GetEmail

func (k *KeycloakClaims) GetEmail() string

GetEmail returns the email from KeycloakClaims

func (*KeycloakClaims) GetOidcId

func (k *KeycloakClaims) GetOidcId() string

GetOidcId returns the oidc_id from KeycloakClaims

func (*KeycloakClaims) GetRealmRoles

func (k *KeycloakClaims) GetRealmRoles() []string

GetRealmRoles returns the realm roles from KeycloakClaims

func (*KeycloakClaims) ToOrgData

func (k *KeycloakClaims) ToOrgData() cdbm.OrgData

ToOrgData parses realm roles and returns a map of organizations to their roles Roles are deduplicated and empty org names or roles are skipped

type NgcAccessClaim

type NgcAccessClaim struct {
	Type    string   `json:"type"`
	Name    string   `json:"name"`
	Actions []string `json:"actions"`
}

NgcAccessClaim represent the custom NGC KAS access claims

type NgcKasClaims

type NgcKasClaims struct {
	Access []NgcAccessClaim `json:"access"`
	jwt.RegisteredClaims
}

NgcKasLegacyClaims represent the custom JWT claims used by NGC KAS

func (*NgcKasClaims) ValidateOrg

func (nc *NgcKasClaims) ValidateOrg(orgName string) bool

ValidateOrg checks whether a specified org name is included in claims

type RealmAccess

type RealmAccess struct {
	Roles []string `json:"roles"`
}

RealmAccess represents the realm_access structure in Keycloak JWT

type SsaClaims

type SsaClaims struct {
	Scopes []string `json:"scopes"`
	jwt.RegisteredClaims
}

SsaClaims represent the custom JWT claims used by SSA

func (*SsaClaims) ValidateScope

func (sc *SsaClaims) ValidateScope(scope string) bool

ValidateScope checks whether a specified scope is included in claims

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL