Documentation
¶
Index ¶
- Constants
- Variables
- func BuildCapabilityContract(input RuntimeContractInput) string
- func BuildEnvironment(apiURL string, token string, projectID uuid.UUID, ticketID uuid.UUID) []string
- func BuildRuntimeEnvironment(input RuntimeContractInput) []string
- func DefaultScopes() []string
- func DefaultScopesForPrincipalKind(kind PrincipalKind) []string
- func ParseBearerToken(header string) (string, error)
- func ParseToken(raw string) (string, error)
- func PrivilegedScopes() []string
- func PrivilegedScopesForPrincipalKind(kind PrincipalKind) []string
- func SupportedScopes() []string
- func SupportedScopesForPrincipalKind(kind PrincipalKind) []string
- type Claims
- type IssueInput
- type IssuedToken
- type PrincipalKind
- type ProjectTokenInventory
- type Repository
- type RuntimeContractInput
- type Scope
- type ScopeGroup
- type ScopeSet
- type ScopeWhitelist
- type Service
Constants ¶
View Source
const ( ScopeTicketsCreate = domain.ScopeTicketsCreate ScopeTicketsList = domain.ScopeTicketsList ScopeTicketsUpdate = domain.ScopeTicketsUpdate ScopeTicketsReportUsage = domain.ScopeTicketsReportUsage ScopeTicketsUpdateSelf = domain.ScopeTicketsUpdateSelf ScopeProjectsUpdate = domain.ScopeProjectsUpdate ScopeProjectsAddRepo = domain.ScopeProjectsAddRepo ScopeActivityRead = domain.ScopeActivityRead ScopeReposCreate = domain.ScopeReposCreate ScopeReposRead = domain.ScopeReposRead ScopeReposUpdate = domain.ScopeReposUpdate ScopeReposDelete = domain.ScopeReposDelete ScopeScheduledJobsList = domain.ScopeScheduledJobsList ScopeScheduledJobsCreate = domain.ScopeScheduledJobsCreate ScopeScheduledJobsUpdate = domain.ScopeScheduledJobsUpdate ScopeScheduledJobsDelete = domain.ScopeScheduledJobsDelete ScopeScheduledJobsTrigger = domain.ScopeScheduledJobsTrigger ScopeSkillsList = domain.ScopeSkillsList ScopeSkillsRead = domain.ScopeSkillsRead ScopeSkillsCreate = domain.ScopeSkillsCreate ScopeSkillsImport = domain.ScopeSkillsImport ScopeSkillsRefresh = domain.ScopeSkillsRefresh ScopeSkillsUpdate = domain.ScopeSkillsUpdate ScopeSkillsDelete = domain.ScopeSkillsDelete ScopeSkillsEnable = domain.ScopeSkillsEnable ScopeSkillsDisable = domain.ScopeSkillsDisable ScopeSkillsBind = domain.ScopeSkillsBind ScopeSkillsRefine = domain.ScopeSkillsRefine ScopeStatusesList = domain.ScopeStatusesList ScopeStatusesCreate = domain.ScopeStatusesCreate ScopeStatusesUpdate = domain.ScopeStatusesUpdate ScopeStatusesDelete = domain.ScopeStatusesDelete ScopeStatusesReset = domain.ScopeStatusesReset ScopeTicketRepoScopesList = domain.ScopeTicketRepoScopesList ScopeTicketRepoScopesCreate = domain.ScopeTicketRepoScopesCreate ScopeTicketRepoScopesUpdate = domain.ScopeTicketRepoScopesUpdate ScopeTicketRepoScopesDelete = domain.ScopeTicketRepoScopesDelete ScopeWorkflowsList = domain.ScopeWorkflowsList ScopeWorkflowsRead = domain.ScopeWorkflowsRead ScopeWorkflowsCreate = domain.ScopeWorkflowsCreate ScopeWorkflowsUpdate = domain.ScopeWorkflowsUpdate ScopeWorkflowsDelete = domain.ScopeWorkflowsDelete ScopeWorkflowsHarnessRead = domain.ScopeWorkflowsHarnessRead ScopeWorkflowsHarnessHistoryRead = domain.ScopeWorkflowsHarnessHistoryRead ScopeWorkflowsHarnessUpdate = domain.ScopeWorkflowsHarnessUpdate ScopeWorkflowsHarnessValidate = domain.ScopeWorkflowsHarnessValidate ScopeWorkflowsHarnessVariablesRead = domain.ScopeWorkflowsHarnessVariablesRead )
View Source
const ( PrincipalKindTicketAgent = domain.PrincipalKindTicketAgent PrincipalKindProjectConversation = domain.PrincipalKindProjectConversation )
View Source
const TokenPrefix = domain.TokenPrefix
Variables ¶
View Source
var ( ErrTokenNotFound = errors.New("agent token not found") ErrTokenExpired = errors.New("agent token expired") ErrInvalidToken = errors.New("agent token is invalid") ErrInvalidScope = errors.New("agent token scope is invalid") ErrInvalidPrincipal = errors.New("agent token principal is invalid") ErrAgentNotFound = errors.New("agent not found") ErrPrincipalNotFound = errors.New("principal not found") ErrProjectMismatch = errors.New("agent token project mismatch") )
Functions ¶
func BuildCapabilityContract ¶
func BuildCapabilityContract(input RuntimeContractInput) string
func BuildEnvironment ¶
func BuildRuntimeEnvironment ¶
func BuildRuntimeEnvironment(input RuntimeContractInput) []string
func DefaultScopes ¶
func DefaultScopes() []string
func DefaultScopesForPrincipalKind ¶
func DefaultScopesForPrincipalKind(kind PrincipalKind) []string
func ParseBearerToken ¶
func ParseToken ¶
func PrivilegedScopes ¶
func PrivilegedScopes() []string
func PrivilegedScopesForPrincipalKind ¶
func PrivilegedScopesForPrincipalKind(kind PrincipalKind) []string
func SupportedScopes ¶
func SupportedScopes() []string
func SupportedScopesForPrincipalKind ¶
func SupportedScopesForPrincipalKind(kind PrincipalKind) []string
Types ¶
type IssueInput ¶
type IssueInput = domain.IssueInput
type IssuedToken ¶
type IssuedToken = domain.IssuedToken
type PrincipalKind ¶
type PrincipalKind = domain.PrincipalKind
type ProjectTokenInventory ¶
type ProjectTokenInventory = domain.ProjectTokenInventory
type Repository ¶
type Repository interface {
AgentPrincipal(ctx context.Context, agentID uuid.UUID) (domain.AgentPrincipal, error)
ProjectConversationPrincipal(ctx context.Context, principalID uuid.UUID) (domain.ProjectConversationPrincipal, error)
CreateToken(ctx context.Context, record domain.CreateTokenRecord) error
TokenByHash(ctx context.Context, tokenHash string) (domain.StoredTokenRecord, error)
TouchTokenLastUsed(ctx context.Context, tokenID uuid.UUID, usedAt time.Time) error
ProjectTokenInventory(ctx context.Context, projectID uuid.UUID, now time.Time) (domain.ProjectTokenInventory, error)
}
type RuntimeContractInput ¶
type RuntimeContractInput = domain.RuntimeContractInput
type ScopeGroup ¶
type ScopeGroup = domain.ScopeGroup
func SupportedScopeGroups ¶
func SupportedScopeGroups() []ScopeGroup
func SupportedScopeGroupsForPrincipalKind ¶
func SupportedScopeGroupsForPrincipalKind(kind PrincipalKind) []ScopeGroup
type ScopeWhitelist ¶
type ScopeWhitelist = domain.ScopeWhitelist
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(repo Repository) *Service
func (*Service) Authenticate ¶
func (*Service) IssueToken ¶
func (s *Service) IssueToken(ctx context.Context, input IssueInput) (IssuedToken, error)
func (*Service) ProjectTokenInventory ¶
Click to show internal directories.
Click to hide internal directories.