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 DefaultAgentScopes() []string
- func DefaultScopesForPrincipalKind(kind PrincipalKind) []string
- func SupportedAgentScopes() []string
- func SupportedScopesForPrincipalKind(kind PrincipalKind) []string
- type AgentPrincipal
- type Claims
- type CreateTokenRecord
- type IssueInput
- type IssuedToken
- type PrincipalKind
- type ProjectConversationPrincipal
- type ProjectTokenInventory
- type RuntimeContractInput
- type Scope
- type ScopeGroup
- type ScopeSet
- type ScopeWhitelist
- type StoredTokenRecord
Constants ¶
View Source
const ( EnvAPIURL = "OPENASE_API_URL" EnvAgentToken = "OPENASE_AGENT_TOKEN" // #nosec G101 -- environment variable key name, not a credential EnvProjectID = "OPENASE_PROJECT_ID" EnvTicketID = "OPENASE_TICKET_ID" EnvConversationID = "OPENASE_CONVERSATION_ID" EnvPrincipalKind = "OPENASE_PRINCIPAL_KIND" EnvAgentScopes = "OPENASE_AGENT_SCOPES" )
View Source
const TokenPrefix = "ase_agent_"
Variables ¶
View Source
var ErrNotFound = errors.New("agent platform record not found")
Functions ¶
func BuildCapabilityContract ¶
func BuildCapabilityContract(input RuntimeContractInput) string
func BuildEnvironment ¶
func BuildRuntimeEnvironment ¶
func BuildRuntimeEnvironment(input RuntimeContractInput) []string
func DefaultAgentScopes ¶
func DefaultAgentScopes() []string
func DefaultScopesForPrincipalKind ¶ added in v0.4.0
func DefaultScopesForPrincipalKind(kind PrincipalKind) []string
func SupportedAgentScopes ¶
func SupportedAgentScopes() []string
func SupportedScopesForPrincipalKind ¶ added in v0.4.0
func SupportedScopesForPrincipalKind(kind PrincipalKind) []string
Types ¶
type Claims ¶
type Claims struct {
TokenID uuid.UUID
PrincipalKind PrincipalKind
PrincipalID uuid.UUID
PrincipalName string
AgentID uuid.UUID
ProjectID uuid.UUID
TicketID uuid.UUID
ConversationID uuid.UUID
Scopes []string
ExpiresAt time.Time
}
func (Claims) IsProjectConversation ¶
func (Claims) IsTicketAgent ¶
type CreateTokenRecord ¶
type IssueInput ¶
type IssuedToken ¶
type PrincipalKind ¶
type PrincipalKind string
const ( PrincipalKindTicketAgent PrincipalKind = "ticket_agent" PrincipalKindProjectConversation PrincipalKind = "project_conversation" )
type ProjectTokenInventory ¶
type RuntimeContractInput ¶
type RuntimeContractInput struct {
PrincipalKind PrincipalKind
ProjectID uuid.UUID
TicketID uuid.UUID
ConversationID uuid.UUID
APIURL string
Token string
Scopes []string
}
func (RuntimeContractInput) String ¶
func (i RuntimeContractInput) String() string
type Scope ¶
type Scope string
const ( ScopeAgentsRead Scope = "agents.read" ScopeAgentsCreate Scope = "agents.create" ScopeAgentsUpdate Scope = "agents.update" ScopeAgentsDelete Scope = "agents.delete" ScopeAgentsPause Scope = "agents.pause" ScopeAgentsResume Scope = "agents.resume" ScopeAgentsInterrupt Scope = "agents.interrupt" ScopeTicketsCreate Scope = "tickets.create" ScopeTicketsList Scope = "tickets.list" ScopeTicketsUpdate Scope = "tickets.update" ScopeTicketsReportUsage Scope = "tickets.report_usage" ScopeTicketsUpdateSelf Scope = "tickets.update.self" ScopeProjectsUpdate Scope = "projects.update" ScopeProjectsAddRepo Scope = "projects.add_repo" ScopeActivityRead Scope = "activity.read" ScopeReposCreate Scope = "repos.create" ScopeReposRead Scope = "repos.read" ScopeReposUpdate Scope = "repos.update" ScopeReposDelete Scope = "repos.delete" ScopeScheduledJobsList Scope = "scheduled_jobs.list" ScopeScheduledJobsCreate Scope = "scheduled_jobs.create" ScopeScheduledJobsUpdate Scope = "scheduled_jobs.update" ScopeScheduledJobsDelete Scope = "scheduled_jobs.delete" ScopeScheduledJobsTrigger Scope = "scheduled_jobs.trigger" ScopeSkillsList Scope = "skills.list" ScopeSkillsRead Scope = "skills.read" ScopeSkillsCreate Scope = "skills.create" ScopeSkillsImport Scope = "skills.import" ScopeSkillsRefresh Scope = "skills.refresh" ScopeSkillsUpdate Scope = "skills.update" ScopeSkillsDelete Scope = "skills.delete" ScopeSkillsEnable Scope = "skills.enable" ScopeSkillsDisable Scope = "skills.disable" ScopeSkillsBind Scope = "skills.bind" ScopeNotificationRulesList Scope = "notification_rules.list" ScopeNotificationRulesCreate Scope = "notification_rules.create" ScopeNotificationRulesUpdate Scope = "notification_rules.update" ScopeNotificationRulesDelete Scope = "notification_rules.delete" ScopeStatusesList Scope = "statuses.list" ScopeStatusesCreate Scope = "statuses.create" ScopeStatusesUpdate Scope = "statuses.update" ScopeStatusesDelete Scope = "statuses.delete" ScopeStatusesReset Scope = "statuses.reset" ScopeTicketRepoScopesList Scope = "ticket_repo_scopes.list" ScopeTicketRepoScopesCreate Scope = "ticket_repo_scopes.create" ScopeTicketRepoScopesUpdate Scope = "ticket_repo_scopes.update" ScopeTicketRepoScopesDelete Scope = "ticket_repo_scopes.delete" ScopeWorkflowsList Scope = "workflows.list" ScopeWorkflowsRead Scope = "workflows.read" ScopeWorkflowsCreate Scope = "workflows.create" ScopeWorkflowsUpdate Scope = "workflows.update" ScopeWorkflowsDelete Scope = "workflows.delete" ScopeWorkflowsHarnessRead Scope = "workflows.harness.read" ScopeWorkflowsHarnessHistoryRead Scope = "workflows.harness.history.read" ScopeWorkflowsHarnessUpdate Scope = "workflows.harness.update" ScopeWorkflowsHarnessValidate Scope = "workflows.harness.validate" ScopeWorkflowsHarnessVariablesRead Scope = "workflows.harness.variables.read" )
type ScopeGroup ¶
type ScopeWhitelist ¶
Click to show internal directories.
Click to hide internal directories.