Documentation
¶
Overview ¶
Package grantex provides a Go SDK for the Grantex delegated authorization protocol.
Create a client with NewClient and use its resource services (Agents, Tokens, Grants, etc.) to interact with the Grantex API.
client := grantex.NewClient("your-api-key")
agent, err := client.Agents.Register(ctx, grantex.RegisterAgentParams{
Name: "My Agent",
Description: "An AI assistant",
Scopes: []string{"read:email", "send:email"},
})
Index ¶
- func VerifyWebhookSignature(payload []byte, signature string, secret string) bool
- type APIError
- type Agent
- type AgentsService
- func (s *AgentsService) Delete(ctx context.Context, agentID string) error
- func (s *AgentsService) Get(ctx context.Context, agentID string) (*Agent, error)
- func (s *AgentsService) List(ctx context.Context) (*ListAgentsResponse, error)
- func (s *AgentsService) Register(ctx context.Context, params RegisterAgentParams) (*Agent, error)
- func (s *AgentsService) Update(ctx context.Context, agentID string, params UpdateAgentParams) (*Agent, error)
- type AllocateBudgetParams
- type AnomaliesService
- type Anomaly
- type AuditEntry
- type AuditService
- type AuthError
- type AuthorizationRequest
- type AuthorizeParams
- type BillingService
- func (s *BillingService) CreateCheckout(ctx context.Context, params CreateCheckoutParams) (*CheckoutResponse, error)
- func (s *BillingService) CreatePortal(ctx context.Context, params CreatePortalParams) (*PortalResponse, error)
- func (s *BillingService) GetSubscription(ctx context.Context) (*SubscriptionStatus, error)
- type BudgetAllocation
- type BudgetTransaction
- type BudgetsService
- func (s *BudgetsService) Allocate(ctx context.Context, params AllocateBudgetParams) (*BudgetAllocation, error)
- func (s *BudgetsService) Allocations(ctx context.Context) ([]BudgetAllocation, error)
- func (s *BudgetsService) Balance(ctx context.Context, grantID string) (*BudgetAllocation, error)
- func (s *BudgetsService) Debit(ctx context.Context, params DebitBudgetParams) (*DebitBudgetResponse, error)
- func (s *BudgetsService) Transactions(ctx context.Context, grantID string) ([]BudgetTransaction, error)
- type ChainIntegrity
- type CheckoutResponse
- type Client
- type CommerceDataResponse
- type CommerceListResponse
- type CommerceProfile
- type CommerceRecord
- type CommerceService
- func (s *CommerceService) ActivatePolicy(ctx context.Context, policyID string) (*CommerceDataResponse, error)
- func (s *CommerceService) BindDeveloperTenant(ctx context.Context, params CommerceRecord) (*CommerceDataResponse, error)
- func (s *CommerceService) BulkUpsertCatalogProducts(ctx context.Context, params CommerceRecord) (*CommerceRecord, error)
- func (s *CommerceService) CreateAgent(ctx context.Context, params CommerceRecord) (*CommerceDataResponse, error)
- func (s *CommerceService) CreateCart(ctx context.Context, params CommerceRecord, idempotencyKey string) (*CommerceDataResponse, error)
- func (s *CommerceService) CreateCatalogProduct(ctx context.Context, params CommerceRecord) (*CommerceDataResponse, error)
- func (s *CommerceService) CreateCheckoutLink(ctx context.Context, paymentIntentID string, params CommerceRecord, ...) (*CommerceDataResponse, error)
- func (s *CommerceService) CreateConsentRequest(ctx context.Context, params CommerceRecord) (*CommerceDataResponse, error)
- func (s *CommerceService) CreateMerchant(ctx context.Context, params CommerceRecord) (*CommerceDataResponse, error)
- func (s *CommerceService) CreatePaymentIntent(ctx context.Context, params CommerceRecord, idempotencyKey string) (*CommerceDataResponse, error)
- func (s *CommerceService) CreatePolicy(ctx context.Context, params CommerceRecord) (*CommerceDataResponse, error)
- func (s *CommerceService) CreateProviderCredential(ctx context.Context, params CommerceRecord) (*CommerceDataResponse, error)
- func (s *CommerceService) CreateTenant(ctx context.Context, params CommerceRecord) (*CommerceDataResponse, error)
- func (s *CommerceService) CreateWebhookSource(ctx context.Context, params CommerceRecord) (*CommerceDataResponse, error)
- func (s *CommerceService) DeleteCatalogProduct(ctx context.Context, productID string) (*CommerceDataResponse, error)
- func (s *CommerceService) EvaluatePolicy(ctx context.Context, params CommerceRecord) (*CommerceDataResponse, error)
- func (s *CommerceService) ExchangeConsentForPassport(ctx context.Context, params CommerceRecord) (*CommerceDataResponse, error)
- func (s *CommerceService) GetAgent(ctx context.Context, agentID string) (*CommerceDataResponse, error)
- func (s *CommerceService) GetCart(ctx context.Context, cartID string) (*CommerceDataResponse, error)
- func (s *CommerceService) GetCatalogProduct(ctx context.Context, productID string, params map[string]string) (*CommerceDataResponse, error)
- func (s *CommerceService) GetMerchant(ctx context.Context, merchantID string) (*CommerceDataResponse, error)
- func (s *CommerceService) GetOpsHealth(ctx context.Context, params map[string]string) (*CommerceRecord, error)
- func (s *CommerceService) GetPaymentIntent(ctx context.Context, paymentIntentID string) (*CommerceDataResponse, error)
- func (s *CommerceService) GetPolicy(ctx context.Context, policyID string) (*CommerceDataResponse, error)
- func (s *CommerceService) GetProfile(ctx context.Context, merchantID string) (*CommerceProfile, error)
- func (s *CommerceService) HandleProviderWebhook(ctx context.Context, providerKey string, payload CommerceRecord, ...) (*CommerceDataResponse, error)
- func (s *CommerceService) ListAgents(ctx context.Context, params map[string]string) (*CommerceListResponse, error)
- func (s *CommerceService) ListAuditEvents(ctx context.Context, params map[string]string) (*CommerceListResponse, error)
- func (s *CommerceService) ListCatalogProducts(ctx context.Context, params map[string]string) (*CommerceListResponse, error)
- func (s *CommerceService) ListPassports(ctx context.Context) (*CommerceListResponse, error)
- func (s *CommerceService) ListPaymentIntents(ctx context.Context, params map[string]string) (*CommerceListResponse, error)
- func (s *CommerceService) ListPolicies(ctx context.Context, params map[string]string) (*CommerceListResponse, error)
- func (s *CommerceService) ListProviderCredentials(ctx context.Context, params map[string]string) (*CommerceListResponse, error)
- func (s *CommerceService) ListProviderWebhookEvents(ctx context.Context, params map[string]string) (*CommerceListResponse, error)
- func (s *CommerceService) ListTenants(ctx context.Context) (*CommerceListResponse, error)
- func (s *CommerceService) ListWebhookSources(ctx context.Context, params map[string]string) (*CommerceListResponse, error)
- func (s *CommerceService) MCP(ctx context.Context, request CommerceRecord) (*CommerceRecord, error)
- func (s *CommerceService) PatchProviderCredential(ctx context.Context, credentialID string, params CommerceRecord) (*CommerceDataResponse, error)
- func (s *CommerceService) ReconcilePaymentIntent(ctx context.Context, paymentIntentID string) (*CommerceDataResponse, error)
- func (s *CommerceService) ReplayProviderWebhookEvent(ctx context.Context, eventID string, params CommerceRecord) (*CommerceDataResponse, error)
- func (s *CommerceService) RevokePassport(ctx context.Context, params CommerceRecord) (*CommerceDataResponse, error)
- func (s *CommerceService) RotateWebhookSourceSecret(ctx context.Context, sourceKey string) (*CommerceDataResponse, error)
- func (s *CommerceService) SearchCatalog(ctx context.Context, params CommerceRecord) (*CommerceListResponse, error)
- func (s *CommerceService) UpdateAgent(ctx context.Context, agentID string, params CommerceRecord) (*CommerceDataResponse, error)
- func (s *CommerceService) UpdateCatalogProduct(ctx context.Context, productID string, params CommerceRecord, ...) (*CommerceDataResponse, error)
- func (s *CommerceService) UpdateMerchant(ctx context.Context, merchantID string, params CommerceRecord) (*CommerceDataResponse, error)
- func (s *CommerceService) UpdateTenant(ctx context.Context, tenantID string, params CommerceRecord) (*CommerceDataResponse, error)
- func (s *CommerceService) UpdateWebhookSource(ctx context.Context, sourceKey string, params CommerceRecord) (*CommerceDataResponse, error)
- func (s *CommerceService) ValidateProviderCredential(ctx context.Context, credentialID string) (*CommerceDataResponse, error)
- func (s *CommerceService) VerifyPassport(ctx context.Context, params CommerceRecord) (*CommerceDataResponse, error)
- type ComplianceAuditExport
- type ComplianceExport
- type ComplianceExportAuditParams
- type ComplianceExportGrantsParams
- type ComplianceGrantsExport
- type ComplianceService
- func (s *ComplianceService) EvidencePack(ctx context.Context, params *EvidencePackParams) (*EvidencePack, error)
- func (s *ComplianceService) ExportAudit(ctx context.Context, params *ComplianceExportAuditParams) (*ComplianceAuditExport, error)
- func (s *ComplianceService) ExportGrants(ctx context.Context, params *ComplianceExportGrantsParams) (*ComplianceGrantsExport, error)
- func (s *ComplianceService) GetSummary(ctx context.Context, params *ComplianceSummaryParams) (*ComplianceSummary, error)
- type ComplianceSummary
- type ComplianceSummaryAgents
- type ComplianceSummaryAuditEntries
- type ComplianceSummaryGrants
- type ComplianceSummaryParams
- type ComplianceSummaryPolicies
- type ConsentNotice
- type ConsentPurpose
- type ConsentRecord
- type CreateCheckoutParams
- type CreateConsentNoticeParams
- type CreateConsentRecordParams
- type CreateDomainParams
- type CreateExportParams
- type CreatePolicyParams
- type CreatePortalParams
- type CreatePrincipalSessionParams
- type CreateScimTokenParams
- type CreateScimUserParams
- type CreateSsoConfigParams
- type CreateSsoConnectionParams
- type CreateWebhookParams
- type CredentialsService
- func (s *CredentialsService) Get(ctx context.Context, id string) (*VerifiableCredentialRecord, error)
- func (s *CredentialsService) List(ctx context.Context, params *ListCredentialsParams) ([]VerifiableCredentialRecord, error)
- func (s *CredentialsService) Present(ctx context.Context, params SDJWTPresentParams) (*SDJWTPresentResult, error)
- func (s *CredentialsService) Verify(ctx context.Context, vcJWT string) (*VCVerificationResult, error)
- type DPDPService
- func (s *DPDPService) CreateConsentNotice(ctx context.Context, params CreateConsentNoticeParams) (*ConsentNotice, error)
- func (s *DPDPService) CreateConsentRecord(ctx context.Context, params CreateConsentRecordParams) (*ConsentRecord, error)
- func (s *DPDPService) CreateExport(ctx context.Context, params CreateExportParams) (*ComplianceExport, error)
- func (s *DPDPService) FileGrievance(ctx context.Context, params FileGrievanceParams) (*Grievance, error)
- func (s *DPDPService) GetConsentRecord(ctx context.Context, recordID string) (*ConsentRecord, error)
- func (s *DPDPService) GetExport(ctx context.Context, exportID string) (*ComplianceExport, error)
- func (s *DPDPService) GetGrievance(ctx context.Context, grievanceID string) (*Grievance, error)
- func (s *DPDPService) ListConsentRecords(ctx context.Context, principalID string) ([]ConsentRecord, error)
- func (s *DPDPService) ListPrincipalRecords(ctx context.Context, principalID string) (*PrincipalRecordsResponse, error)
- func (s *DPDPService) RequestErasure(ctx context.Context, principalID string) (*ErasureResponse, error)
- func (s *DPDPService) WithdrawConsent(ctx context.Context, recordID string, params WithdrawConsentParams) (*WithdrawConsentResponse, error)
- type DebitBudgetParams
- type DebitBudgetResponse
- type DelegateParams
- type DelegateResponse
- type DetectAnomaliesResponse
- type Domain
- type DomainsService
- func (s *DomainsService) Create(ctx context.Context, params CreateDomainParams) (*Domain, error)
- func (s *DomainsService) Delete(ctx context.Context, id string) error
- func (s *DomainsService) List(ctx context.Context) ([]Domain, error)
- func (s *DomainsService) Verify(ctx context.Context, id string) (*VerifyDomainResponse, error)
- type ErasureResponse
- type Event
- type EventsService
- type EvidencePack
- type EvidencePackMeta
- type EvidencePackParams
- type ExchangeCredentialParams
- type ExchangeCredentialResponse
- type ExchangeTokenParams
- type ExchangeTokenResponse
- type FileGrievanceParams
- type GetPassportResponse
- type Grant
- type GrantsService
- func (s *GrantsService) Delegate(ctx context.Context, params DelegateParams) (*DelegateResponse, error)
- func (s *GrantsService) Get(ctx context.Context, grantID string) (*Grant, error)
- func (s *GrantsService) List(ctx context.Context, params *ListGrantsParams) (*ListGrantsResponse, error)
- func (s *GrantsService) Revoke(ctx context.Context, grantID string) error
- type Grievance
- type GrievanceOfficer
- type IssuePassportParams
- type IssuedPassportResponse
- type ListAgentsResponse
- type ListAnomaliesParams
- type ListAnomaliesResponse
- type ListAuditParams
- type ListAuditResponse
- type ListCredentialsParams
- type ListGrantsParams
- type ListGrantsResponse
- type ListPassportsParams
- type ListPoliciesResponse
- type ListScimTokensResponse
- type ListScimUsersParams
- type ListSsoConnectionsResponse
- type ListSsoSessionsResponse
- type ListVaultCredentialsParams
- type ListWebhooksResponse
- type LogAuditParams
- type NetworkError
- type Option
- type PKCEChallenge
- type PassportsService
- func (s *PassportsService) Get(ctx context.Context, passportID string) (*GetPassportResponse, error)
- func (s *PassportsService) Issue(ctx context.Context, params IssuePassportParams) (*IssuedPassportResponse, error)
- func (s *PassportsService) List(ctx context.Context, params *ListPassportsParams) ([]IssuedPassportResponse, error)
- func (s *PassportsService) Revoke(ctx context.Context, passportID string) (*RevokePassportResponse, error)
- type PoliciesService
- func (s *PoliciesService) Create(ctx context.Context, params CreatePolicyParams) (*Policy, error)
- func (s *PoliciesService) Delete(ctx context.Context, policyID string) error
- func (s *PoliciesService) Get(ctx context.Context, policyID string) (*Policy, error)
- func (s *PoliciesService) List(ctx context.Context) (*ListPoliciesResponse, error)
- func (s *PoliciesService) Update(ctx context.Context, policyID string, params UpdatePolicyParams) (*Policy, error)
- type Policy
- type PortalResponse
- type PrincipalRecordsResponse
- type PrincipalSessionResponse
- type PrincipalSessionsService
- type RateLimit
- type RefreshTokenParams
- type RegisterAgentParams
- type RevokePassportResponse
- type RotateKeyResponse
- type SCIMService
- func (s *SCIMService) CreateToken(ctx context.Context, label string) (*ScimTokenWithSecret, error)
- func (s *SCIMService) CreateUser(ctx context.Context, params CreateScimUserParams) (*ScimUser, error)
- func (s *SCIMService) DeleteUser(ctx context.Context, userID string) error
- func (s *SCIMService) GetUser(ctx context.Context, userID string) (*ScimUser, error)
- func (s *SCIMService) ListTokens(ctx context.Context) (*ListScimTokensResponse, error)
- func (s *SCIMService) ListUsers(ctx context.Context, params *ListScimUsersParams) (*ScimListResponse, error)
- func (s *SCIMService) ReplaceUser(ctx context.Context, userID string, params CreateScimUserParams) (*ScimUser, error)
- func (s *SCIMService) RevokeToken(ctx context.Context, tokenID string) error
- func (s *SCIMService) UpdateUser(ctx context.Context, userID string, ops []ScimOperation) (*ScimUser, error)
- type SDJWTPresentParams
- type SDJWTPresentResult
- type SSOService
- func (s *SSOService) CreateConfig(ctx context.Context, params CreateSsoConfigParams) (*SsoConfig, error)
- func (s *SSOService) CreateConnection(ctx context.Context, params CreateSsoConnectionParams) (*SsoConnection, error)
- func (s *SSOService) DeleteConfig(ctx context.Context) error
- func (s *SSOService) DeleteConnection(ctx context.Context, id string) error
- func (s *SSOService) GetConfig(ctx context.Context) (*SsoConfig, error)
- func (s *SSOService) GetConnection(ctx context.Context, id string) (*SsoConnection, error)
- func (s *SSOService) GetLoginURL(ctx context.Context, org string, domain ...string) (*SsoLoginResponse, error)
- func (s *SSOService) HandleCallback(ctx context.Context, code string, state string) (*SsoCallbackResponse, error)
- func (s *SSOService) HandleLdapCallback(ctx context.Context, params SsoLdapCallbackParams) (*SsoCallbackResult, error)
- func (s *SSOService) HandleOidcCallback(ctx context.Context, params SsoOidcCallbackParams) (*SsoCallbackResult, error)
- func (s *SSOService) HandleSamlCallback(ctx context.Context, params SsoSamlCallbackParams) (*SsoCallbackResult, error)
- func (s *SSOService) ListConnections(ctx context.Context) (*ListSsoConnectionsResponse, error)
- func (s *SSOService) ListSessions(ctx context.Context) (*ListSsoSessionsResponse, error)
- func (s *SSOService) RevokeSession(ctx context.Context, id string) error
- func (s *SSOService) SetEnforcement(ctx context.Context, params SsoEnforcementParams) (*SsoEnforcementResponse, error)
- func (s *SSOService) TestConnection(ctx context.Context, id string) (*SsoConnectionTestResult, error)
- func (s *SSOService) UpdateConnection(ctx context.Context, id string, params UpdateSsoConnectionParams) (*SsoConnection, error)
- type ScimEmail
- type ScimListResponse
- type ScimOperation
- type ScimToken
- type ScimTokenWithSecret
- type ScimUser
- type ScimUserMeta
- type SignupParams
- type SignupResponse
- type SsoCallbackResponse
- type SsoCallbackResult
- type SsoConfig
- type SsoConnection
- type SsoConnectionTestResult
- type SsoEnforcementParams
- type SsoEnforcementResponse
- type SsoLdapCallbackParams
- type SsoLoginResponse
- type SsoOidcCallbackParams
- type SsoSamlCallbackParams
- type SsoSession
- type StoreCredentialParams
- type StoreCredentialResponse
- type SubscriptionStatus
- type TokenError
- type TokensService
- func (s *TokensService) Exchange(ctx context.Context, params ExchangeTokenParams) (*ExchangeTokenResponse, error)
- func (s *TokensService) Refresh(ctx context.Context, params RefreshTokenParams) (*ExchangeTokenResponse, error)
- func (s *TokensService) Revoke(ctx context.Context, tokenID string) error
- func (s *TokensService) Verify(ctx context.Context, token string) (*VerifyTokenResponse, error)
- type TransactionAmount
- type UpdateAgentParams
- type UpdatePolicyParams
- type UpdateSsoConnectionParams
- type UsageHistoryEntry
- type UsageResponse
- type UsageService
- type VCVerificationResult
- type VaultCredential
- type VaultService
- func (s *VaultService) Delete(ctx context.Context, credentialID string) error
- func (s *VaultService) Exchange(ctx context.Context, grantToken string, params ExchangeCredentialParams) (*ExchangeCredentialResponse, error)
- func (s *VaultService) Get(ctx context.Context, credentialID string) (*VaultCredential, error)
- func (s *VaultService) List(ctx context.Context, params *ListVaultCredentialsParams) ([]VaultCredential, error)
- func (s *VaultService) Store(ctx context.Context, params StoreCredentialParams) (*StoreCredentialResponse, error)
- type VerifiableCredentialRecord
- type VerifiedGrant
- type VerifyDomainResponse
- type VerifyOptions
- type VerifyTokenResponse
- type WebAuthnCredential
- type WebAuthnRegisterOptionsParams
- type WebAuthnRegisterVerifyParams
- type WebAuthnRegistrationOptions
- type WebAuthnService
- func (s *WebAuthnService) DeleteCredential(ctx context.Context, id string) error
- func (s *WebAuthnService) ListCredentials(ctx context.Context, principalID string) ([]WebAuthnCredential, error)
- func (s *WebAuthnService) RegisterOptions(ctx context.Context, params WebAuthnRegisterOptionsParams) (*WebAuthnRegistrationOptions, error)
- func (s *WebAuthnService) RegisterVerify(ctx context.Context, params WebAuthnRegisterVerifyParams) (*WebAuthnCredential, error)
- type WebhookEndpoint
- type WebhookEndpointWithSecret
- type WebhooksService
- type WithdrawConsentParams
- type WithdrawConsentResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type APIError ¶
type APIError struct {
StatusCode int
Body json.RawMessage
Code string
RequestID string
Message string
RateLimit *RateLimit
}
APIError represents a non-2xx HTTP response from the Grantex API.
type Agent ¶
type Agent struct {
ID string `json:"id"`
DID string `json:"did"`
Name string `json:"name"`
Description string `json:"description"`
Scopes []string `json:"scopes"`
Status string `json:"status"`
DeveloperID string `json:"developerId"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
}
Agent represents a registered agent.
type AgentsService ¶
type AgentsService struct {
// contains filtered or unexported fields
}
AgentsService handles agent registration and management.
func (*AgentsService) Delete ¶
func (s *AgentsService) Delete(ctx context.Context, agentID string) error
Delete removes an agent.
func (*AgentsService) List ¶
func (s *AgentsService) List(ctx context.Context) (*ListAgentsResponse, error)
List retrieves all agents for the current developer.
func (*AgentsService) Register ¶
func (s *AgentsService) Register(ctx context.Context, params RegisterAgentParams) (*Agent, error)
Register creates a new agent.
func (*AgentsService) Update ¶
func (s *AgentsService) Update(ctx context.Context, agentID string, params UpdateAgentParams) (*Agent, error)
Update modifies an existing agent.
type AllocateBudgetParams ¶ added in v0.1.3
type AllocateBudgetParams struct {
GrantID string `json:"grantId"`
InitialBudget float64 `json:"initialBudget"`
}
AllocateBudgetParams contains the parameters for allocating a budget.
type AnomaliesService ¶
type AnomaliesService struct {
// contains filtered or unexported fields
}
AnomaliesService handles anomaly detection and management.
func (*AnomaliesService) Acknowledge ¶
Acknowledge marks an anomaly as acknowledged.
func (*AnomaliesService) Detect ¶
func (s *AnomaliesService) Detect(ctx context.Context) (*DetectAnomaliesResponse, error)
Detect triggers anomaly detection and returns results.
func (*AnomaliesService) List ¶
func (s *AnomaliesService) List(ctx context.Context, params *ListAnomaliesParams) (*ListAnomaliesResponse, error)
List retrieves anomalies with optional filters.
type Anomaly ¶
type Anomaly struct {
ID string `json:"id"`
Type string `json:"type"`
Severity string `json:"severity"`
AgentID *string `json:"agentId"`
PrincipalID *string `json:"principalId"`
Description string `json:"description"`
Metadata map[string]interface{} `json:"metadata"`
DetectedAt string `json:"detectedAt"`
AcknowledgedAt *string `json:"acknowledgedAt"`
}
Anomaly represents a detected anomaly.
type AuditEntry ¶
type AuditEntry struct {
EntryID string `json:"entryId"`
AgentID string `json:"agentId"`
AgentDID string `json:"agentDid"`
GrantID string `json:"grantId"`
PrincipalID string `json:"principalId"`
Action string `json:"action"`
Metadata map[string]interface{} `json:"metadata"`
Hash string `json:"hash"`
PrevHash *string `json:"prevHash"`
Timestamp string `json:"timestamp"`
Status string `json:"status"`
}
AuditEntry represents an audit log entry.
type AuditService ¶
type AuditService struct {
// contains filtered or unexported fields
}
AuditService handles audit logging and retrieval.
func (*AuditService) Get ¶
func (s *AuditService) Get(ctx context.Context, entryID string) (*AuditEntry, error)
Get retrieves a single audit entry by ID.
func (*AuditService) List ¶
func (s *AuditService) List(ctx context.Context, params *ListAuditParams) (*ListAuditResponse, error)
List retrieves audit log entries with optional filters.
func (*AuditService) Log ¶
func (s *AuditService) Log(ctx context.Context, params LogAuditParams) (*AuditEntry, error)
Log creates an audit log entry.
type AuthorizationRequest ¶
type AuthorizationRequest struct {
AuthRequestID string `json:"authRequestId"`
ConsentURL string `json:"consentUrl"`
AgentID string `json:"agentId"`
PrincipalID string `json:"principalId"`
Scopes []string `json:"scopes"`
ExpiresIn string `json:"expiresIn"`
ExpiresAt string `json:"expiresAt"`
Status string `json:"status"`
CreatedAt string `json:"createdAt"`
}
AuthorizationRequest is the response from creating an authorization request.
type AuthorizeParams ¶
type AuthorizeParams struct {
Audience string `json:"audience,omitempty"`
AgentID string `json:"agentId"`
PrincipalID string `json:"principalId"`
Scopes []string `json:"scopes"`
ExpiresIn string `json:"expiresIn,omitempty"`
RedirectURI string `json:"redirectUri,omitempty"`
CodeChallenge string `json:"codeChallenge,omitempty"`
CodeChallengeMethod string `json:"codeChallengeMethod,omitempty"`
}
AuthorizeParams are the parameters for creating an authorization request.
type BillingService ¶
type BillingService struct {
// contains filtered or unexported fields
}
BillingService handles subscription and billing operations.
func (*BillingService) CreateCheckout ¶
func (s *BillingService) CreateCheckout(ctx context.Context, params CreateCheckoutParams) (*CheckoutResponse, error)
CreateCheckout creates a checkout session for upgrading.
func (*BillingService) CreatePortal ¶
func (s *BillingService) CreatePortal(ctx context.Context, params CreatePortalParams) (*PortalResponse, error)
CreatePortal creates a billing portal session.
func (*BillingService) GetSubscription ¶
func (s *BillingService) GetSubscription(ctx context.Context) (*SubscriptionStatus, error)
GetSubscription retrieves the current subscription status.
type BudgetAllocation ¶ added in v0.1.3
type BudgetAllocation struct {
ID string `json:"id"`
GrantID string `json:"grantId"`
DeveloperID string `json:"developerId"`
InitialBudget string `json:"initialBudget"`
RemainingBudget string `json:"remainingBudget"`
Currency string `json:"currency"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
}
BudgetAllocation represents a budget allocation record.
type BudgetTransaction ¶ added in v0.1.3
type BudgetTransaction struct {
ID string `json:"id"`
GrantID string `json:"grantId"`
AllocationID string `json:"allocationId"`
Amount string `json:"amount"`
Description string `json:"description"`
Metadata map[string]interface{} `json:"metadata"`
CreatedAt string `json:"createdAt"`
}
BudgetTransaction represents a single budget transaction.
type BudgetsService ¶ added in v0.1.3
type BudgetsService struct {
// contains filtered or unexported fields
}
BudgetsService handles budget allocation and tracking.
func (*BudgetsService) Allocate ¶ added in v0.1.3
func (s *BudgetsService) Allocate(ctx context.Context, params AllocateBudgetParams) (*BudgetAllocation, error)
Allocate creates a new budget allocation for a grant.
func (*BudgetsService) Allocations ¶ added in v0.1.3
func (s *BudgetsService) Allocations(ctx context.Context) ([]BudgetAllocation, error)
Allocations lists all budget allocations.
func (*BudgetsService) Balance ¶ added in v0.1.3
func (s *BudgetsService) Balance(ctx context.Context, grantID string) (*BudgetAllocation, error)
Balance retrieves the current budget balance for a grant.
func (*BudgetsService) Debit ¶ added in v0.1.3
func (s *BudgetsService) Debit(ctx context.Context, params DebitBudgetParams) (*DebitBudgetResponse, error)
Debit debits an amount from a grant's budget.
func (*BudgetsService) Transactions ¶ added in v0.1.3
func (s *BudgetsService) Transactions(ctx context.Context, grantID string) ([]BudgetTransaction, error)
Transactions lists budget transactions for a grant.
type ChainIntegrity ¶
type ChainIntegrity struct {
Valid bool `json:"valid"`
CheckedEntries int `json:"checkedEntries"`
FirstBrokenAt *string `json:"firstBrokenAt"`
}
ChainIntegrity represents audit chain integrity check results.
type CheckoutResponse ¶
type CheckoutResponse struct {
CheckoutURL string `json:"checkoutUrl"`
}
CheckoutResponse is the response from creating a checkout.
type Client ¶
type Client struct {
Agents *AgentsService
Tokens *TokensService
Grants *GrantsService
Audit *AuditService
Webhooks *WebhooksService
Billing *BillingService
Policies *PoliciesService
Compliance *ComplianceService
Anomalies *AnomaliesService
SCIM *SCIMService
SSO *SSOService
PrincipalSessions *PrincipalSessionsService
Budgets *BudgetsService
Events *EventsService
Usage *UsageService
Domains *DomainsService
WebAuthn *WebAuthnService
Credentials *CredentialsService
Passports *PassportsService
Vault *VaultService
DPDP *DPDPService
Commerce *CommerceService
// contains filtered or unexported fields
}
Client is the main entry point for the Grantex SDK.
func (*Client) Authorize ¶
func (c *Client) Authorize(ctx context.Context, params AuthorizeParams) (*AuthorizationRequest, error)
Authorize creates an authorization request for a user to grant permissions to an agent.
func (*Client) LastRateLimit ¶ added in v0.1.1
LastRateLimit returns the rate limit metadata from the most recent API response, or nil if unavailable.
type CommerceDataResponse ¶ added in v0.1.10
type CommerceDataResponse struct {
Data CommerceRecord `json:"data,omitempty"`
AuditEventID string `json:"audit_event_id,omitempty"`
}
CommerceDataResponse is the common Commerce response shape for write/read resources.
type CommerceListResponse ¶ added in v0.1.10
type CommerceListResponse struct {
Items []CommerceRecord `json:"items"`
NextCursor *string `json:"next_cursor,omitempty"`
}
CommerceListResponse is the common Commerce list response shape.
type CommerceProfile ¶ added in v0.1.10
type CommerceProfile struct {
Version string `json:"version,omitempty"`
Merchant CommerceRecord `json:"merchant,omitempty"`
SupportedTools []string `json:"supported_tools,omitempty"`
Capabilities []CommerceRecord `json:"capabilities,omitempty"`
}
CommerceProfile is the public Commerce V1/OACP merchant discovery profile.
type CommerceRecord ¶ added in v0.1.10
type CommerceRecord map[string]interface{}
CommerceRecord is a flexible Commerce V1 JSON object.
type CommerceService ¶ added in v0.1.10
type CommerceService struct {
// contains filtered or unexported fields
}
CommerceService handles Commerce V1/OACP operations.
func (*CommerceService) ActivatePolicy ¶ added in v0.1.10
func (s *CommerceService) ActivatePolicy(ctx context.Context, policyID string) (*CommerceDataResponse, error)
func (*CommerceService) BindDeveloperTenant ¶ added in v0.1.10
func (s *CommerceService) BindDeveloperTenant(ctx context.Context, params CommerceRecord) (*CommerceDataResponse, error)
func (*CommerceService) BulkUpsertCatalogProducts ¶ added in v0.1.10
func (s *CommerceService) BulkUpsertCatalogProducts(ctx context.Context, params CommerceRecord) (*CommerceRecord, error)
func (*CommerceService) CreateAgent ¶ added in v0.1.10
func (s *CommerceService) CreateAgent(ctx context.Context, params CommerceRecord) (*CommerceDataResponse, error)
func (*CommerceService) CreateCart ¶ added in v0.1.10
func (s *CommerceService) CreateCart(ctx context.Context, params CommerceRecord, idempotencyKey string) (*CommerceDataResponse, error)
func (*CommerceService) CreateCatalogProduct ¶ added in v0.1.10
func (s *CommerceService) CreateCatalogProduct(ctx context.Context, params CommerceRecord) (*CommerceDataResponse, error)
func (*CommerceService) CreateCheckoutLink ¶ added in v0.1.10
func (s *CommerceService) CreateCheckoutLink(ctx context.Context, paymentIntentID string, params CommerceRecord, idempotencyKey string) (*CommerceDataResponse, error)
func (*CommerceService) CreateConsentRequest ¶ added in v0.1.10
func (s *CommerceService) CreateConsentRequest(ctx context.Context, params CommerceRecord) (*CommerceDataResponse, error)
func (*CommerceService) CreateMerchant ¶ added in v0.1.10
func (s *CommerceService) CreateMerchant(ctx context.Context, params CommerceRecord) (*CommerceDataResponse, error)
func (*CommerceService) CreatePaymentIntent ¶ added in v0.1.10
func (s *CommerceService) CreatePaymentIntent(ctx context.Context, params CommerceRecord, idempotencyKey string) (*CommerceDataResponse, error)
func (*CommerceService) CreatePolicy ¶ added in v0.1.10
func (s *CommerceService) CreatePolicy(ctx context.Context, params CommerceRecord) (*CommerceDataResponse, error)
func (*CommerceService) CreateProviderCredential ¶ added in v0.1.10
func (s *CommerceService) CreateProviderCredential(ctx context.Context, params CommerceRecord) (*CommerceDataResponse, error)
func (*CommerceService) CreateTenant ¶ added in v0.1.10
func (s *CommerceService) CreateTenant(ctx context.Context, params CommerceRecord) (*CommerceDataResponse, error)
func (*CommerceService) CreateWebhookSource ¶ added in v0.1.10
func (s *CommerceService) CreateWebhookSource(ctx context.Context, params CommerceRecord) (*CommerceDataResponse, error)
func (*CommerceService) DeleteCatalogProduct ¶ added in v0.1.10
func (s *CommerceService) DeleteCatalogProduct(ctx context.Context, productID string) (*CommerceDataResponse, error)
func (*CommerceService) EvaluatePolicy ¶ added in v0.1.10
func (s *CommerceService) EvaluatePolicy(ctx context.Context, params CommerceRecord) (*CommerceDataResponse, error)
func (*CommerceService) ExchangeConsentForPassport ¶ added in v0.1.10
func (s *CommerceService) ExchangeConsentForPassport(ctx context.Context, params CommerceRecord) (*CommerceDataResponse, error)
func (*CommerceService) GetAgent ¶ added in v0.1.10
func (s *CommerceService) GetAgent(ctx context.Context, agentID string) (*CommerceDataResponse, error)
func (*CommerceService) GetCart ¶ added in v0.1.10
func (s *CommerceService) GetCart(ctx context.Context, cartID string) (*CommerceDataResponse, error)
func (*CommerceService) GetCatalogProduct ¶ added in v0.1.10
func (s *CommerceService) GetCatalogProduct(ctx context.Context, productID string, params map[string]string) (*CommerceDataResponse, error)
func (*CommerceService) GetMerchant ¶ added in v0.1.10
func (s *CommerceService) GetMerchant(ctx context.Context, merchantID string) (*CommerceDataResponse, error)
func (*CommerceService) GetOpsHealth ¶ added in v0.1.10
func (s *CommerceService) GetOpsHealth(ctx context.Context, params map[string]string) (*CommerceRecord, error)
func (*CommerceService) GetPaymentIntent ¶ added in v0.1.10
func (s *CommerceService) GetPaymentIntent(ctx context.Context, paymentIntentID string) (*CommerceDataResponse, error)
func (*CommerceService) GetPolicy ¶ added in v0.1.10
func (s *CommerceService) GetPolicy(ctx context.Context, policyID string) (*CommerceDataResponse, error)
func (*CommerceService) GetProfile ¶ added in v0.1.10
func (s *CommerceService) GetProfile(ctx context.Context, merchantID string) (*CommerceProfile, error)
func (*CommerceService) HandleProviderWebhook ¶ added in v0.1.10
func (s *CommerceService) HandleProviderWebhook(ctx context.Context, providerKey string, payload CommerceRecord, headers map[string]string) (*CommerceDataResponse, error)
func (*CommerceService) ListAgents ¶ added in v0.1.10
func (s *CommerceService) ListAgents(ctx context.Context, params map[string]string) (*CommerceListResponse, error)
func (*CommerceService) ListAuditEvents ¶ added in v0.1.10
func (s *CommerceService) ListAuditEvents(ctx context.Context, params map[string]string) (*CommerceListResponse, error)
func (*CommerceService) ListCatalogProducts ¶ added in v0.1.10
func (s *CommerceService) ListCatalogProducts(ctx context.Context, params map[string]string) (*CommerceListResponse, error)
func (*CommerceService) ListPassports ¶ added in v0.1.10
func (s *CommerceService) ListPassports(ctx context.Context) (*CommerceListResponse, error)
func (*CommerceService) ListPaymentIntents ¶ added in v0.1.10
func (s *CommerceService) ListPaymentIntents(ctx context.Context, params map[string]string) (*CommerceListResponse, error)
func (*CommerceService) ListPolicies ¶ added in v0.1.10
func (s *CommerceService) ListPolicies(ctx context.Context, params map[string]string) (*CommerceListResponse, error)
func (*CommerceService) ListProviderCredentials ¶ added in v0.1.10
func (s *CommerceService) ListProviderCredentials(ctx context.Context, params map[string]string) (*CommerceListResponse, error)
func (*CommerceService) ListProviderWebhookEvents ¶ added in v0.1.10
func (s *CommerceService) ListProviderWebhookEvents(ctx context.Context, params map[string]string) (*CommerceListResponse, error)
func (*CommerceService) ListTenants ¶ added in v0.1.10
func (s *CommerceService) ListTenants(ctx context.Context) (*CommerceListResponse, error)
func (*CommerceService) ListWebhookSources ¶ added in v0.1.10
func (s *CommerceService) ListWebhookSources(ctx context.Context, params map[string]string) (*CommerceListResponse, error)
func (*CommerceService) MCP ¶ added in v0.1.10
func (s *CommerceService) MCP(ctx context.Context, request CommerceRecord) (*CommerceRecord, error)
func (*CommerceService) PatchProviderCredential ¶ added in v0.1.10
func (s *CommerceService) PatchProviderCredential(ctx context.Context, credentialID string, params CommerceRecord) (*CommerceDataResponse, error)
func (*CommerceService) ReconcilePaymentIntent ¶ added in v0.1.10
func (s *CommerceService) ReconcilePaymentIntent(ctx context.Context, paymentIntentID string) (*CommerceDataResponse, error)
func (*CommerceService) ReplayProviderWebhookEvent ¶ added in v0.1.10
func (s *CommerceService) ReplayProviderWebhookEvent(ctx context.Context, eventID string, params CommerceRecord) (*CommerceDataResponse, error)
func (*CommerceService) RevokePassport ¶ added in v0.1.10
func (s *CommerceService) RevokePassport(ctx context.Context, params CommerceRecord) (*CommerceDataResponse, error)
func (*CommerceService) RotateWebhookSourceSecret ¶ added in v0.1.10
func (s *CommerceService) RotateWebhookSourceSecret(ctx context.Context, sourceKey string) (*CommerceDataResponse, error)
func (*CommerceService) SearchCatalog ¶ added in v0.1.10
func (s *CommerceService) SearchCatalog(ctx context.Context, params CommerceRecord) (*CommerceListResponse, error)
func (*CommerceService) UpdateAgent ¶ added in v0.1.10
func (s *CommerceService) UpdateAgent(ctx context.Context, agentID string, params CommerceRecord) (*CommerceDataResponse, error)
func (*CommerceService) UpdateCatalogProduct ¶ added in v0.1.10
func (s *CommerceService) UpdateCatalogProduct(ctx context.Context, productID string, params CommerceRecord, query map[string]string) (*CommerceDataResponse, error)
func (*CommerceService) UpdateMerchant ¶ added in v0.1.10
func (s *CommerceService) UpdateMerchant(ctx context.Context, merchantID string, params CommerceRecord) (*CommerceDataResponse, error)
func (*CommerceService) UpdateTenant ¶ added in v0.1.10
func (s *CommerceService) UpdateTenant(ctx context.Context, tenantID string, params CommerceRecord) (*CommerceDataResponse, error)
func (*CommerceService) UpdateWebhookSource ¶ added in v0.1.10
func (s *CommerceService) UpdateWebhookSource(ctx context.Context, sourceKey string, params CommerceRecord) (*CommerceDataResponse, error)
func (*CommerceService) ValidateProviderCredential ¶ added in v0.1.10
func (s *CommerceService) ValidateProviderCredential(ctx context.Context, credentialID string) (*CommerceDataResponse, error)
func (*CommerceService) VerifyPassport ¶ added in v0.1.10
func (s *CommerceService) VerifyPassport(ctx context.Context, params CommerceRecord) (*CommerceDataResponse, error)
type ComplianceAuditExport ¶
type ComplianceAuditExport struct {
GeneratedAt string `json:"generatedAt"`
Total int `json:"total"`
Entries []AuditEntry `json:"entries"`
}
ComplianceAuditExport is the exported audit data.
type ComplianceExport ¶ added in v0.1.10
type ComplianceExport struct {
ExportID string `json:"exportId"`
Type string `json:"type"`
Status string `json:"status,omitempty"`
Format string `json:"format,omitempty"`
RecordCount int `json:"recordCount,omitempty"`
Data map[string]interface{} `json:"data,omitempty"`
DateFrom string `json:"dateFrom,omitempty"`
DateTo string `json:"dateTo,omitempty"`
ExpiresAt string `json:"expiresAt,omitempty"`
CreatedAt string `json:"createdAt,omitempty"`
}
ComplianceExport represents a DPDP compliance export.
type ComplianceExportAuditParams ¶
type ComplianceExportAuditParams struct {
Since string `json:"since,omitempty"`
Until string `json:"until,omitempty"`
AgentID string `json:"agentId,omitempty"`
Status string `json:"status,omitempty"`
}
ComplianceExportAuditParams are the parameters for exporting audit entries.
type ComplianceExportGrantsParams ¶
type ComplianceExportGrantsParams struct {
Since string `json:"since,omitempty"`
Until string `json:"until,omitempty"`
Status string `json:"status,omitempty"`
}
ComplianceExportGrantsParams are the parameters for exporting grants.
type ComplianceGrantsExport ¶
type ComplianceGrantsExport struct {
GeneratedAt string `json:"generatedAt"`
Total int `json:"total"`
Grants []Grant `json:"grants"`
}
ComplianceGrantsExport is the exported grants data.
type ComplianceService ¶
type ComplianceService struct {
// contains filtered or unexported fields
}
ComplianceService handles compliance reporting and evidence exports.
func (*ComplianceService) EvidencePack ¶
func (s *ComplianceService) EvidencePack(ctx context.Context, params *EvidencePackParams) (*EvidencePack, error)
EvidencePack generates a compliance evidence package.
func (*ComplianceService) ExportAudit ¶
func (s *ComplianceService) ExportAudit(ctx context.Context, params *ComplianceExportAuditParams) (*ComplianceAuditExport, error)
ExportAudit exports audit data for compliance.
func (*ComplianceService) ExportGrants ¶
func (s *ComplianceService) ExportGrants(ctx context.Context, params *ComplianceExportGrantsParams) (*ComplianceGrantsExport, error)
ExportGrants exports grants data for compliance.
func (*ComplianceService) GetSummary ¶
func (s *ComplianceService) GetSummary(ctx context.Context, params *ComplianceSummaryParams) (*ComplianceSummary, error)
GetSummary retrieves a compliance summary.
type ComplianceSummary ¶
type ComplianceSummary struct {
GeneratedAt string `json:"generatedAt"`
Since *string `json:"since,omitempty"`
Until *string `json:"until,omitempty"`
Agents ComplianceSummaryAgents `json:"agents"`
Grants ComplianceSummaryGrants `json:"grants"`
AuditEntries ComplianceSummaryAuditEntries `json:"auditEntries"`
Policies ComplianceSummaryPolicies `json:"policies"`
Plan string `json:"plan"`
}
ComplianceSummary is the compliance overview.
type ComplianceSummaryAgents ¶
type ComplianceSummaryAgents struct {
Total int `json:"total"`
Active int `json:"active"`
Suspended int `json:"suspended"`
Revoked int `json:"revoked"`
}
ComplianceSummaryAgents is agent stats in a compliance summary.
type ComplianceSummaryAuditEntries ¶
type ComplianceSummaryAuditEntries struct {
Total int `json:"total"`
Success int `json:"success"`
Failure int `json:"failure"`
Blocked int `json:"blocked"`
}
ComplianceSummaryAuditEntries is audit stats in a compliance summary.
type ComplianceSummaryGrants ¶
type ComplianceSummaryGrants struct {
Total int `json:"total"`
Active int `json:"active"`
Revoked int `json:"revoked"`
Expired int `json:"expired"`
}
ComplianceSummaryGrants is grant stats in a compliance summary.
type ComplianceSummaryParams ¶
type ComplianceSummaryParams struct {
Since string `json:"since,omitempty"`
Until string `json:"until,omitempty"`
}
ComplianceSummaryParams are the parameters for getting a compliance summary.
type ComplianceSummaryPolicies ¶
type ComplianceSummaryPolicies struct {
Total int `json:"total"`
}
ComplianceSummaryPolicies is policy stats in a compliance summary.
type ConsentNotice ¶ added in v0.1.10
type ConsentNotice struct {
ID string `json:"id"`
NoticeID string `json:"noticeId"`
Version string `json:"version"`
Language string `json:"language"`
ContentHash string `json:"contentHash"`
CreatedAt string `json:"createdAt"`
}
ConsentNotice represents a registered consent notice version.
type ConsentPurpose ¶ added in v0.1.10
ConsentPurpose describes a data processing purpose for DPDP consent.
type ConsentRecord ¶ added in v0.1.10
type ConsentRecord struct {
RecordID string `json:"recordId"`
GrantID string `json:"grantId"`
DataPrincipalID string `json:"dataPrincipalId"`
Status string `json:"status"`
ConsentNoticeHash string `json:"consentNoticeHash,omitempty"`
ConsentProof map[string]interface{} `json:"consentProof,omitempty"`
ProcessingExpiresAt string `json:"processingExpiresAt,omitempty"`
RetentionUntil string `json:"retentionUntil,omitempty"`
DataFiduciaryName string `json:"dataFiduciaryName,omitempty"`
Purposes []ConsentPurpose `json:"purposes,omitempty"`
Scopes []string `json:"scopes,omitempty"`
ConsentNoticeID string `json:"consentNoticeId,omitempty"`
ConsentGivenAt string `json:"consentGivenAt,omitempty"`
AccessCount int `json:"accessCount,omitempty"`
LastAccessedAt string `json:"lastAccessedAt,omitempty"`
WithdrawnAt *string `json:"withdrawnAt"`
WithdrawnReason *string `json:"withdrawnReason"`
CreatedAt string `json:"createdAt,omitempty"`
}
ConsentRecord represents a DPDP consent record.
type CreateCheckoutParams ¶
type CreateCheckoutParams struct {
Plan string `json:"plan"`
SuccessURL string `json:"successUrl"`
CancelURL string `json:"cancelUrl"`
}
CreateCheckoutParams are the parameters for creating a checkout session.
type CreateConsentNoticeParams ¶ added in v0.1.10
type CreateConsentNoticeParams struct {
NoticeID string `json:"noticeId"`
Version string `json:"version"`
Title string `json:"title"`
Content string `json:"content"`
Purposes []ConsentPurpose `json:"purposes"`
Language string `json:"language,omitempty"`
DataFiduciaryContact string `json:"dataFiduciaryContact,omitempty"`
GrievanceOfficer *GrievanceOfficer `json:"grievanceOfficer,omitempty"`
}
CreateConsentNoticeParams contains the parameters for creating a consent notice.
type CreateConsentRecordParams ¶ added in v0.1.10
type CreateConsentRecordParams struct {
GrantID string `json:"grantId"`
DataPrincipalID string `json:"dataPrincipalId"`
Purposes []ConsentPurpose `json:"purposes"`
ConsentNoticeID string `json:"consentNoticeId"`
ProcessingExpiresAt string `json:"processingExpiresAt"`
}
CreateConsentRecordParams contains the parameters for creating a consent record.
type CreateDomainParams ¶ added in v0.1.3
type CreateDomainParams struct {
Domain string `json:"domain"`
}
CreateDomainParams contains the parameters for creating a custom domain.
type CreateExportParams ¶ added in v0.1.10
type CreateExportParams struct {
Type string `json:"type"`
DateFrom string `json:"dateFrom"`
DateTo string `json:"dateTo"`
Format string `json:"format,omitempty"`
IncludeActionLog *bool `json:"includeActionLog,omitempty"`
IncludeConsentRecords *bool `json:"includeConsentRecords,omitempty"`
DataPrincipalID string `json:"dataPrincipalId,omitempty"`
}
CreateExportParams contains the parameters for creating a compliance export.
type CreatePolicyParams ¶
type CreatePolicyParams struct {
Name string `json:"name"`
Effect string `json:"effect"`
Priority *int `json:"priority,omitempty"`
AgentID string `json:"agentId,omitempty"`
PrincipalID string `json:"principalId,omitempty"`
Scopes []string `json:"scopes,omitempty"`
TimeOfDayStart string `json:"timeOfDayStart,omitempty"`
TimeOfDayEnd string `json:"timeOfDayEnd,omitempty"`
}
CreatePolicyParams are the parameters for creating a policy.
type CreatePortalParams ¶
type CreatePortalParams struct {
ReturnURL string `json:"returnUrl"`
}
CreatePortalParams are the parameters for creating a billing portal session.
type CreatePrincipalSessionParams ¶
type CreatePrincipalSessionParams struct {
PrincipalID string `json:"principalId"`
ExpiresIn string `json:"expiresIn,omitempty"`
}
CreatePrincipalSessionParams are the parameters for creating a principal session.
type CreateScimTokenParams ¶
type CreateScimTokenParams struct {
Label string `json:"label"`
}
CreateScimTokenParams are the parameters for creating a SCIM token.
type CreateScimUserParams ¶
type CreateScimUserParams struct {
UserName string `json:"userName"`
DisplayName string `json:"displayName,omitempty"`
ExternalID string `json:"externalId,omitempty"`
Emails []ScimEmail `json:"emails,omitempty"`
Active *bool `json:"active,omitempty"`
}
CreateScimUserParams are the parameters for creating a SCIM user.
type CreateSsoConfigParams ¶
type CreateSsoConfigParams struct {
IssuerURL string `json:"issuerUrl"`
ClientID string `json:"clientId"`
ClientSecret string `json:"clientSecret"`
RedirectURI string `json:"redirectUri"`
}
CreateSsoConfigParams are the parameters for creating an SSO configuration.
type CreateSsoConnectionParams ¶ added in v0.1.4
type CreateSsoConnectionParams struct {
Name string `json:"name"`
Protocol string `json:"protocol"`
IssuerURL string `json:"issuerUrl,omitempty"`
ClientID string `json:"clientId,omitempty"`
ClientSecret string `json:"clientSecret,omitempty"`
IdpEntityID string `json:"idpEntityId,omitempty"`
IdpSsoURL string `json:"idpSsoUrl,omitempty"`
IdpCertificate string `json:"idpCertificate,omitempty"`
LdapURL string `json:"ldapUrl,omitempty"`
LdapBindDN string `json:"ldapBindDn,omitempty"`
LdapBindPassword string `json:"ldapBindPassword,omitempty"`
LdapSearchBase string `json:"ldapSearchBase,omitempty"`
LdapSearchFilter string `json:"ldapSearchFilter,omitempty"`
LdapGroupSearchBase string `json:"ldapGroupSearchBase,omitempty"`
LdapGroupSearchFilter string `json:"ldapGroupSearchFilter,omitempty"`
LdapTlsEnabled bool `json:"ldapTlsEnabled,omitempty"`
Domains []string `json:"domains,omitempty"`
JitProvisioning bool `json:"jitProvisioning,omitempty"`
GroupAttribute string `json:"groupAttribute,omitempty"`
GroupMappings map[string][]string `json:"groupMappings,omitempty"`
DefaultScopes []string `json:"defaultScopes,omitempty"`
}
CreateSsoConnectionParams are the parameters for creating an SSO connection.
type CreateWebhookParams ¶
CreateWebhookParams are the parameters for creating a webhook.
type CredentialsService ¶ added in v0.1.3
type CredentialsService struct {
// contains filtered or unexported fields
}
CredentialsService handles Verifiable Credential operations.
func (*CredentialsService) Get ¶ added in v0.1.3
func (s *CredentialsService) Get(ctx context.Context, id string) (*VerifiableCredentialRecord, error)
Get retrieves a Verifiable Credential by ID.
func (*CredentialsService) List ¶ added in v0.1.3
func (s *CredentialsService) List(ctx context.Context, params *ListCredentialsParams) ([]VerifiableCredentialRecord, error)
List retrieves Verifiable Credentials with optional filters.
func (*CredentialsService) Present ¶ added in v0.1.3
func (s *CredentialsService) Present(ctx context.Context, params SDJWTPresentParams) (*SDJWTPresentResult, error)
Present creates an SD-JWT presentation with selective disclosure.
func (*CredentialsService) Verify ¶ added in v0.1.3
func (s *CredentialsService) Verify(ctx context.Context, vcJWT string) (*VCVerificationResult, error)
Verify verifies a VC-JWT.
type DPDPService ¶ added in v0.1.10
type DPDPService struct {
// contains filtered or unexported fields
}
DPDPService handles DPDP (Digital Personal Data Protection Act 2023) operations.
func (*DPDPService) CreateConsentNotice ¶ added in v0.1.10
func (s *DPDPService) CreateConsentNotice(ctx context.Context, params CreateConsentNoticeParams) (*ConsentNotice, error)
CreateConsentNotice registers a consent notice version.
func (*DPDPService) CreateConsentRecord ¶ added in v0.1.10
func (s *DPDPService) CreateConsentRecord(ctx context.Context, params CreateConsentRecordParams) (*ConsentRecord, error)
CreateConsentRecord creates a DPDP consent record linked to a Grantex grant.
func (*DPDPService) CreateExport ¶ added in v0.1.10
func (s *DPDPService) CreateExport(ctx context.Context, params CreateExportParams) (*ComplianceExport, error)
CreateExport generates a compliance export (DPDP audit, GDPR Article 15, EU AI Act).
func (*DPDPService) FileGrievance ¶ added in v0.1.10
func (s *DPDPService) FileGrievance(ctx context.Context, params FileGrievanceParams) (*Grievance, error)
FileGrievance files a grievance under DPDP section 13(6).
func (*DPDPService) GetConsentRecord ¶ added in v0.1.10
func (s *DPDPService) GetConsentRecord(ctx context.Context, recordID string) (*ConsentRecord, error)
GetConsentRecord fetches a single consent record by ID.
func (*DPDPService) GetExport ¶ added in v0.1.10
func (s *DPDPService) GetExport(ctx context.Context, exportID string) (*ComplianceExport, error)
GetExport retrieves an export by ID.
func (*DPDPService) GetGrievance ¶ added in v0.1.10
GetGrievance retrieves a grievance by ID.
func (*DPDPService) ListConsentRecords ¶ added in v0.1.10
func (s *DPDPService) ListConsentRecords(ctx context.Context, principalID string) ([]ConsentRecord, error)
ListConsentRecords lists consent records, optionally filtered by data principal ID.
func (*DPDPService) ListPrincipalRecords ¶ added in v0.1.10
func (s *DPDPService) ListPrincipalRecords(ctx context.Context, principalID string) (*PrincipalRecordsResponse, error)
ListPrincipalRecords lists all consent records for a data principal (right to access).
func (*DPDPService) RequestErasure ¶ added in v0.1.10
func (s *DPDPService) RequestErasure(ctx context.Context, principalID string) (*ErasureResponse, error)
RequestErasure submits a data erasure request for a data principal.
func (*DPDPService) WithdrawConsent ¶ added in v0.1.10
func (s *DPDPService) WithdrawConsent(ctx context.Context, recordID string, params WithdrawConsentParams) (*WithdrawConsentResponse, error)
WithdrawConsent withdraws consent for a consent record.
type DebitBudgetParams ¶ added in v0.1.3
type DebitBudgetParams struct {
GrantID string `json:"grantId"`
Amount float64 `json:"amount"`
Description string `json:"description,omitempty"`
}
DebitBudgetParams contains the parameters for debiting a budget.
type DebitBudgetResponse ¶ added in v0.1.3
type DebitBudgetResponse struct {
Remaining string `json:"remaining"`
TransactionID string `json:"transactionId"`
}
DebitBudgetResponse is the response from a budget debit operation.
type DelegateParams ¶
type DelegateParams struct {
ParentGrantToken string `json:"parentGrantToken"`
SubAgentID string `json:"subAgentId"`
Scopes []string `json:"scopes"`
ExpiresIn string `json:"expiresIn,omitempty"`
}
DelegateParams are the parameters for grant delegation.
type DelegateResponse ¶
type DelegateResponse struct {
GrantToken string `json:"grantToken"`
ExpiresAt string `json:"expiresAt"`
Scopes []string `json:"scopes"`
GrantID string `json:"grantId"`
}
DelegateResponse is the response from grant delegation.
type DetectAnomaliesResponse ¶
type DetectAnomaliesResponse struct {
DetectedAt string `json:"detectedAt"`
Total int `json:"total"`
Anomalies []Anomaly `json:"anomalies"`
}
DetectAnomaliesResponse is the response from anomaly detection.
type Domain ¶ added in v0.1.3
type Domain struct {
ID string `json:"id"`
Domain string `json:"domain"`
Verified bool `json:"verified"`
VerificationToken string `json:"verificationToken"`
Instructions string `json:"instructions"`
CreatedAt string `json:"createdAt"`
}
Domain represents a custom domain record.
type DomainsService ¶ added in v0.1.3
type DomainsService struct {
// contains filtered or unexported fields
}
DomainsService handles custom domain management.
func (*DomainsService) Create ¶ added in v0.1.3
func (s *DomainsService) Create(ctx context.Context, params CreateDomainParams) (*Domain, error)
Create registers a new custom domain.
func (*DomainsService) Delete ¶ added in v0.1.3
func (s *DomainsService) Delete(ctx context.Context, id string) error
Delete removes a custom domain.
func (*DomainsService) List ¶ added in v0.1.3
func (s *DomainsService) List(ctx context.Context) ([]Domain, error)
List retrieves all registered custom domains.
func (*DomainsService) Verify ¶ added in v0.1.3
func (s *DomainsService) Verify(ctx context.Context, id string) (*VerifyDomainResponse, error)
Verify triggers DNS verification for a domain.
type ErasureResponse ¶ added in v0.1.10
type ErasureResponse struct {
RequestID string `json:"requestId"`
DataPrincipalID string `json:"dataPrincipalId"`
Status string `json:"status"`
RecordsErased int `json:"recordsErased"`
GrantsRevoked int `json:"grantsRevoked"`
SubmittedAt string `json:"submittedAt"`
ExpectedCompletionBy string `json:"expectedCompletionBy"`
}
ErasureResponse is the result of a data erasure request.
type EventsService ¶ added in v0.1.3
type EventsService struct {
// contains filtered or unexported fields
}
EventsService handles real-time event streaming.
type EvidencePack ¶
type EvidencePack struct {
Meta EvidencePackMeta `json:"meta"`
Summary ComplianceSummary `json:"summary"`
Grants []Grant `json:"grants"`
AuditEntries []AuditEntry `json:"auditEntries"`
Policies []Policy `json:"policies"`
ChainIntegrity ChainIntegrity `json:"chainIntegrity"`
}
EvidencePack is a compliance evidence package.
type EvidencePackMeta ¶
type EvidencePackMeta struct {
SchemaVersion string `json:"schemaVersion"`
GeneratedAt string `json:"generatedAt"`
Since *string `json:"since,omitempty"`
Until *string `json:"until,omitempty"`
Framework string `json:"framework"`
}
EvidencePackMeta is metadata for an evidence pack.
type EvidencePackParams ¶
type EvidencePackParams struct {
Since string `json:"since,omitempty"`
Until string `json:"until,omitempty"`
Framework string `json:"framework,omitempty"`
}
EvidencePackParams are the parameters for generating an evidence pack.
type ExchangeCredentialParams ¶ added in v0.1.4
type ExchangeCredentialParams struct {
Service string `json:"service"`
}
ExchangeCredentialParams contains the parameters for exchanging a grant token for a credential.
type ExchangeCredentialResponse ¶ added in v0.1.4
type ExchangeCredentialResponse struct {
AccessToken string `json:"accessToken"`
Service string `json:"service"`
CredentialType string `json:"credentialType"`
TokenExpiresAt *string `json:"tokenExpiresAt"`
Metadata map[string]interface{} `json:"metadata"`
}
ExchangeCredentialResponse is the response from exchanging a grant token for a credential.
type ExchangeTokenParams ¶
type ExchangeTokenParams struct {
Code string `json:"code"`
AgentID string `json:"agentId"`
CodeVerifier string `json:"codeVerifier,omitempty"`
}
ExchangeTokenParams are the parameters for exchanging an authorization code.
type ExchangeTokenResponse ¶
type ExchangeTokenResponse struct {
GrantToken string `json:"grantToken"`
ExpiresAt string `json:"expiresAt"`
Scopes []string `json:"scopes"`
RefreshToken string `json:"refreshToken"`
GrantID string `json:"grantId"`
}
ExchangeTokenResponse is the response from token exchange or refresh.
type FileGrievanceParams ¶ added in v0.1.10
type FileGrievanceParams struct {
DataPrincipalID string `json:"dataPrincipalId"`
Type string `json:"type"`
Description string `json:"description"`
RecordID string `json:"recordId,omitempty"`
Evidence map[string]interface{} `json:"evidence,omitempty"`
}
FileGrievanceParams contains the parameters for filing a DPDP grievance.
type GetPassportResponse ¶ added in v0.1.4
type GetPassportResponse struct {
Status string `json:"status"`
}
GetPassportResponse is the response from getting a passport by ID.
type Grant ¶
type Grant struct {
ID string `json:"grantId"`
AgentID string `json:"agentId"`
AgentDID string `json:"agentDid"`
PrincipalID string `json:"principalId"`
DeveloperID string `json:"developerId"`
Scopes []string `json:"scopes"`
Status string `json:"status"`
IssuedAt string `json:"issuedAt"`
ExpiresAt string `json:"expiresAt"`
RevokedAt *string `json:"revokedAt,omitempty"`
}
Grant represents an authorization grant.
type GrantsService ¶
type GrantsService struct {
// contains filtered or unexported fields
}
GrantsService handles grant management and delegation.
func (*GrantsService) Delegate ¶
func (s *GrantsService) Delegate(ctx context.Context, params DelegateParams) (*DelegateResponse, error)
Delegate creates a delegated grant for a sub-agent.
func (*GrantsService) List ¶
func (s *GrantsService) List(ctx context.Context, params *ListGrantsParams) (*ListGrantsResponse, error)
List retrieves grants with optional filters.
type Grievance ¶ added in v0.1.10
type Grievance struct {
GrievanceID string `json:"grievanceId"`
Status string `json:"status"`
Type string `json:"type,omitempty"`
ReferenceNumber string `json:"referenceNumber,omitempty"`
DataPrincipalID string `json:"dataPrincipalId,omitempty"`
RecordID *string `json:"recordId"`
Description string `json:"description,omitempty"`
Evidence map[string]interface{} `json:"evidence,omitempty"`
ExpectedResolutionBy string `json:"expectedResolutionBy,omitempty"`
ResolvedAt *string `json:"resolvedAt"`
Resolution *string `json:"resolution"`
CreatedAt string `json:"createdAt,omitempty"`
}
Grievance represents a DPDP grievance.
type GrievanceOfficer ¶ added in v0.1.10
type GrievanceOfficer struct {
Name string `json:"name"`
Email string `json:"email"`
Phone string `json:"phone,omitempty"`
}
GrievanceOfficer represents the grievance officer contact info in a consent notice.
type IssuePassportParams ¶ added in v0.1.4
type IssuePassportParams struct {
AgentID string `json:"agentId"`
GrantID string `json:"grantId"`
AllowedMPPCategories []string `json:"allowedMPPCategories"`
MaxTransactionAmount TransactionAmount `json:"maxTransactionAmount"`
PaymentRails []string `json:"paymentRails,omitempty"`
ExpiresIn string `json:"expiresIn,omitempty"`
ParentPassportID string `json:"parentPassportId,omitempty"`
}
IssuePassportParams contains the parameters for issuing an agent passport.
type IssuedPassportResponse ¶ added in v0.1.4
type IssuedPassportResponse struct {
PassportID string `json:"passportId"`
Credential map[string]interface{} `json:"credential"`
EncodedCredential string `json:"encodedCredential"`
ExpiresAt string `json:"expiresAt"`
}
IssuedPassportResponse is the response from issuing an agent passport.
type ListAgentsResponse ¶
type ListAgentsResponse struct {
Agents []Agent `json:"agents"`
Total int `json:"total"`
Page int `json:"page"`
PageSize int `json:"pageSize"`
}
ListAgentsResponse is the response from listing agents.
type ListAnomaliesParams ¶
type ListAnomaliesParams struct {
Unacknowledged *bool `json:"unacknowledged,omitempty"`
}
ListAnomaliesParams are the parameters for listing anomalies.
type ListAnomaliesResponse ¶
type ListAnomaliesResponse struct {
Anomalies []Anomaly `json:"anomalies"`
Total int `json:"total"`
}
ListAnomaliesResponse is the response from listing anomalies.
type ListAuditParams ¶
type ListAuditParams struct {
AgentID string `json:"agentId,omitempty"`
GrantID string `json:"grantId,omitempty"`
PrincipalID string `json:"principalId,omitempty"`
Action string `json:"action,omitempty"`
Since string `json:"since,omitempty"`
Until string `json:"until,omitempty"`
Page int `json:"page,omitempty"`
PageSize int `json:"pageSize,omitempty"`
}
ListAuditParams are the parameters for listing audit entries.
type ListAuditResponse ¶
type ListAuditResponse struct {
Entries []AuditEntry `json:"entries"`
Total int `json:"total"`
Page int `json:"page"`
PageSize int `json:"pageSize"`
}
ListAuditResponse is the response from listing audit entries.
type ListCredentialsParams ¶ added in v0.1.3
ListCredentialsParams contains optional filters for listing credentials.
type ListGrantsParams ¶
type ListGrantsParams struct {
AgentID string `json:"agentId,omitempty"`
PrincipalID string `json:"principalId,omitempty"`
Status string `json:"status,omitempty"`
Page int `json:"page,omitempty"`
PageSize int `json:"pageSize,omitempty"`
}
ListGrantsParams are the parameters for listing grants.
type ListGrantsResponse ¶
type ListGrantsResponse struct {
Grants []Grant `json:"grants"`
Total int `json:"total"`
Page int `json:"page"`
PageSize int `json:"pageSize"`
}
ListGrantsResponse is the response from listing grants.
type ListPassportsParams ¶ added in v0.1.4
ListPassportsParams contains optional filters for listing passports.
type ListPoliciesResponse ¶
ListPoliciesResponse is the response from listing policies.
type ListScimTokensResponse ¶
type ListScimTokensResponse struct {
Tokens []ScimToken `json:"tokens"`
}
ListScimTokensResponse is the response from listing SCIM tokens.
type ListScimUsersParams ¶
type ListScimUsersParams struct {
StartIndex int `json:"startIndex,omitempty"`
Count int `json:"count,omitempty"`
}
ListScimUsersParams are the parameters for listing SCIM users.
type ListSsoConnectionsResponse ¶ added in v0.1.4
type ListSsoConnectionsResponse struct {
Connections []SsoConnection `json:"connections"`
}
ListSsoConnectionsResponse is the response from listing SSO connections.
type ListSsoSessionsResponse ¶ added in v0.1.4
type ListSsoSessionsResponse struct {
Sessions []SsoSession `json:"sessions"`
}
ListSsoSessionsResponse is the response from listing SSO sessions.
type ListVaultCredentialsParams ¶ added in v0.1.4
ListVaultCredentialsParams contains optional filters for listing vault credentials.
type ListWebhooksResponse ¶
type ListWebhooksResponse struct {
Webhooks []WebhookEndpoint `json:"webhooks"`
}
ListWebhooksResponse is the response from listing webhooks.
type LogAuditParams ¶
type LogAuditParams struct {
AgentID string `json:"agentId"`
GrantID string `json:"grantId"`
Action string `json:"action"`
Metadata map[string]interface{} `json:"metadata,omitempty"`
Status string `json:"status,omitempty"`
}
LogAuditParams are the parameters for logging an audit entry.
type NetworkError ¶
NetworkError represents a network-level failure (DNS, timeout, connection refused).
func (*NetworkError) Error ¶
func (e *NetworkError) Error() string
func (*NetworkError) Unwrap ¶
func (e *NetworkError) Unwrap() error
type Option ¶
type Option func(*clientConfig)
Option configures a Grantex client.
func WithBaseURL ¶
WithBaseURL sets the API base URL. Defaults to "https://api.grantex.dev".
func WithHTTPClient ¶
WithHTTPClient sets a custom http.Client for requests.
func WithMaxRetries ¶ added in v0.1.5
WithMaxRetries sets the maximum number of retry attempts for transient failures (HTTP 429, 502, 503, 504, and network errors). Defaults to 3. Set to 0 to disable retries.
func WithTimeout ¶
WithTimeout sets the HTTP request timeout. Defaults to 30 seconds.
type PKCEChallenge ¶
type PKCEChallenge struct {
CodeVerifier string
CodeChallenge string
CodeChallengeMethod string // Always "S256"
}
PKCEChallenge holds a PKCE code verifier and its S256 challenge.
func GeneratePKCE ¶
func GeneratePKCE() (*PKCEChallenge, error)
GeneratePKCE creates a new PKCE code verifier and S256 challenge pair.
type PassportsService ¶ added in v0.1.4
type PassportsService struct {
// contains filtered or unexported fields
}
PassportsService handles Agent Passport Credential operations.
func (*PassportsService) Get ¶ added in v0.1.4
func (s *PassportsService) Get(ctx context.Context, passportID string) (*GetPassportResponse, error)
Get retrieves a passport by ID.
func (*PassportsService) Issue ¶ added in v0.1.4
func (s *PassportsService) Issue(ctx context.Context, params IssuePassportParams) (*IssuedPassportResponse, error)
Issue creates a new Agent Passport Credential.
func (*PassportsService) List ¶ added in v0.1.4
func (s *PassportsService) List(ctx context.Context, params *ListPassportsParams) ([]IssuedPassportResponse, error)
List retrieves passports with optional filters.
func (*PassportsService) Revoke ¶ added in v0.1.4
func (s *PassportsService) Revoke(ctx context.Context, passportID string) (*RevokePassportResponse, error)
Revoke revokes a passport by ID.
type PoliciesService ¶
type PoliciesService struct {
// contains filtered or unexported fields
}
PoliciesService handles access policy management.
func (*PoliciesService) Create ¶
func (s *PoliciesService) Create(ctx context.Context, params CreatePolicyParams) (*Policy, error)
Create creates a new access policy.
func (*PoliciesService) Delete ¶
func (s *PoliciesService) Delete(ctx context.Context, policyID string) error
Delete removes a policy.
func (*PoliciesService) List ¶
func (s *PoliciesService) List(ctx context.Context) (*ListPoliciesResponse, error)
List retrieves all policies.
func (*PoliciesService) Update ¶
func (s *PoliciesService) Update(ctx context.Context, policyID string, params UpdatePolicyParams) (*Policy, error)
Update modifies an existing policy.
type Policy ¶
type Policy struct {
ID string `json:"id"`
Name string `json:"name"`
Effect string `json:"effect"`
Priority int `json:"priority"`
AgentID *string `json:"agentId"`
PrincipalID *string `json:"principalId"`
Scopes []string `json:"scopes"`
TimeOfDayStart *string `json:"timeOfDayStart"`
TimeOfDayEnd *string `json:"timeOfDayEnd"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
}
Policy represents an access policy.
type PortalResponse ¶
type PortalResponse struct {
PortalURL string `json:"portalUrl"`
}
PortalResponse is the response from creating a portal session.
type PrincipalRecordsResponse ¶ added in v0.1.10
type PrincipalRecordsResponse struct {
DataPrincipalID string `json:"dataPrincipalId"`
Records []ConsentRecord `json:"records"`
TotalRecords int `json:"totalRecords"`
}
PrincipalRecordsResponse contains the consent records for a data principal.
type PrincipalSessionResponse ¶
type PrincipalSessionResponse struct {
SessionToken string `json:"sessionToken"`
DashboardURL string `json:"dashboardUrl"`
ExpiresAt string `json:"expiresAt"`
}
PrincipalSessionResponse is the response from creating a principal session.
type PrincipalSessionsService ¶
type PrincipalSessionsService struct {
// contains filtered or unexported fields
}
PrincipalSessionsService handles principal session management.
func (*PrincipalSessionsService) Create ¶
func (s *PrincipalSessionsService) Create(ctx context.Context, params CreatePrincipalSessionParams) (*PrincipalSessionResponse, error)
Create creates a new principal session for end-user dashboard access.
type RateLimit ¶ added in v0.1.1
RateLimit contains rate limit metadata parsed from response headers.
type RefreshTokenParams ¶
type RefreshTokenParams struct {
RefreshToken string `json:"refreshToken"`
AgentID string `json:"agentId"`
}
RefreshTokenParams are the parameters for refreshing a token.
type RegisterAgentParams ¶
type RegisterAgentParams struct {
Name string `json:"name"`
Description string `json:"description"`
Scopes []string `json:"scopes"`
}
RegisterAgentParams are the parameters for registering an agent.
type RevokePassportResponse ¶ added in v0.1.4
type RevokePassportResponse struct {
Revoked bool `json:"revoked"`
RevokedAt string `json:"revokedAt"`
}
RevokePassportResponse is the response from revoking a passport.
type RotateKeyResponse ¶
RotateKeyResponse is returned from RotateKey.
type SCIMService ¶
type SCIMService struct {
// contains filtered or unexported fields
}
SCIMService handles SCIM 2.0 provisioning operations.
func (*SCIMService) CreateToken ¶
func (s *SCIMService) CreateToken(ctx context.Context, label string) (*ScimTokenWithSecret, error)
CreateToken creates a new SCIM provisioning token.
func (*SCIMService) CreateUser ¶
func (s *SCIMService) CreateUser(ctx context.Context, params CreateScimUserParams) (*ScimUser, error)
CreateUser creates a new SCIM user.
func (*SCIMService) DeleteUser ¶
func (s *SCIMService) DeleteUser(ctx context.Context, userID string) error
DeleteUser removes a SCIM user.
func (*SCIMService) ListTokens ¶
func (s *SCIMService) ListTokens(ctx context.Context) (*ListScimTokensResponse, error)
ListTokens retrieves all SCIM provisioning tokens.
func (*SCIMService) ListUsers ¶
func (s *SCIMService) ListUsers(ctx context.Context, params *ListScimUsersParams) (*ScimListResponse, error)
ListUsers retrieves SCIM users with optional pagination.
func (*SCIMService) ReplaceUser ¶
func (s *SCIMService) ReplaceUser(ctx context.Context, userID string, params CreateScimUserParams) (*ScimUser, error)
ReplaceUser replaces a SCIM user (PUT).
func (*SCIMService) RevokeToken ¶
func (s *SCIMService) RevokeToken(ctx context.Context, tokenID string) error
RevokeToken revokes a SCIM provisioning token.
func (*SCIMService) UpdateUser ¶
func (s *SCIMService) UpdateUser(ctx context.Context, userID string, ops []ScimOperation) (*ScimUser, error)
UpdateUser performs a SCIM PATCH operation on a user.
type SDJWTPresentParams ¶ added in v0.1.3
type SDJWTPresentParams struct {
SDJWT string `json:"sdJwt"`
DisclosedClaims []string `json:"disclosedClaims"`
}
SDJWTPresentParams contains the parameters for creating an SD-JWT presentation.
type SDJWTPresentResult ¶ added in v0.1.3
type SDJWTPresentResult struct {
Presentation string `json:"presentation"`
}
SDJWTPresentResult is the result of creating an SD-JWT presentation.
type SSOService ¶
type SSOService struct {
// contains filtered or unexported fields
}
SSOService handles SSO configuration, connections, and authentication.
func (*SSOService) CreateConfig ¶
func (s *SSOService) CreateConfig(ctx context.Context, params CreateSsoConfigParams) (*SsoConfig, error)
CreateConfig creates an SSO configuration. Deprecated: Use CreateConnection for enterprise SSO.
func (*SSOService) CreateConnection ¶ added in v0.1.4
func (s *SSOService) CreateConnection(ctx context.Context, params CreateSsoConnectionParams) (*SsoConnection, error)
CreateConnection creates a new SSO connection (OIDC or SAML).
func (*SSOService) DeleteConfig ¶
func (s *SSOService) DeleteConfig(ctx context.Context) error
DeleteConfig removes the SSO configuration. Deprecated: Use DeleteConnection for enterprise SSO.
func (*SSOService) DeleteConnection ¶ added in v0.1.4
func (s *SSOService) DeleteConnection(ctx context.Context, id string) error
DeleteConnection deletes an SSO connection.
func (*SSOService) GetConfig ¶
func (s *SSOService) GetConfig(ctx context.Context) (*SsoConfig, error)
GetConfig retrieves the current SSO configuration. Deprecated: Use ListConnections for enterprise SSO.
func (*SSOService) GetConnection ¶ added in v0.1.4
func (s *SSOService) GetConnection(ctx context.Context, id string) (*SsoConnection, error)
GetConnection retrieves an SSO connection by ID.
func (*SSOService) GetLoginURL ¶
func (s *SSOService) GetLoginURL(ctx context.Context, org string, domain ...string) (*SsoLoginResponse, error)
GetLoginURL gets the SSO login URL for an organization, with an optional domain hint.
func (*SSOService) HandleCallback ¶
func (s *SSOService) HandleCallback(ctx context.Context, code string, state string) (*SsoCallbackResponse, error)
HandleCallback processes an SSO callback. Deprecated: Use HandleOidcCallback or HandleSamlCallback for enterprise SSO.
func (*SSOService) HandleLdapCallback ¶ added in v0.1.4
func (s *SSOService) HandleLdapCallback(ctx context.Context, params SsoLdapCallbackParams) (*SsoCallbackResult, error)
HandleLdapCallback processes an LDAP SSO callback with bind authentication.
func (*SSOService) HandleOidcCallback ¶ added in v0.1.4
func (s *SSOService) HandleOidcCallback(ctx context.Context, params SsoOidcCallbackParams) (*SsoCallbackResult, error)
HandleOidcCallback processes an OIDC SSO callback.
func (*SSOService) HandleSamlCallback ¶ added in v0.1.4
func (s *SSOService) HandleSamlCallback(ctx context.Context, params SsoSamlCallbackParams) (*SsoCallbackResult, error)
HandleSamlCallback processes a SAML SSO callback.
func (*SSOService) ListConnections ¶ added in v0.1.4
func (s *SSOService) ListConnections(ctx context.Context) (*ListSsoConnectionsResponse, error)
ListConnections lists all SSO connections.
func (*SSOService) ListSessions ¶ added in v0.1.4
func (s *SSOService) ListSessions(ctx context.Context) (*ListSsoSessionsResponse, error)
ListSessions lists active SSO sessions.
func (*SSOService) RevokeSession ¶ added in v0.1.4
func (s *SSOService) RevokeSession(ctx context.Context, id string) error
RevokeSession revokes an SSO session by ID.
func (*SSOService) SetEnforcement ¶ added in v0.1.4
func (s *SSOService) SetEnforcement(ctx context.Context, params SsoEnforcementParams) (*SsoEnforcementResponse, error)
SetEnforcement configures SSO enforcement settings.
func (*SSOService) TestConnection ¶ added in v0.1.4
func (s *SSOService) TestConnection(ctx context.Context, id string) (*SsoConnectionTestResult, error)
TestConnection tests an SSO connection's configuration.
func (*SSOService) UpdateConnection ¶ added in v0.1.4
func (s *SSOService) UpdateConnection(ctx context.Context, id string, params UpdateSsoConnectionParams) (*SsoConnection, error)
UpdateConnection updates an existing SSO connection.
type ScimListResponse ¶
type ScimListResponse struct {
TotalResults int `json:"totalResults"`
StartIndex int `json:"startIndex"`
ItemsPerPage int `json:"itemsPerPage"`
Resources []ScimUser `json:"Resources"`
}
ScimListResponse is the SCIM list response.
type ScimOperation ¶
type ScimOperation struct {
Op string `json:"op"`
Path string `json:"path,omitempty"`
Value interface{} `json:"value,omitempty"`
}
ScimOperation represents a SCIM PATCH operation.
type ScimToken ¶
type ScimToken struct {
ID string `json:"id"`
Label string `json:"label"`
CreatedAt string `json:"createdAt"`
LastUsedAt *string `json:"lastUsedAt"`
}
ScimToken represents a SCIM provisioning token.
type ScimTokenWithSecret ¶
type ScimTokenWithSecret struct {
ID string `json:"id"`
Label string `json:"label"`
CreatedAt string `json:"createdAt"`
LastUsedAt *string `json:"lastUsedAt"`
Token string `json:"token"`
}
ScimTokenWithSecret is a SCIM token that includes the secret value.
type ScimUser ¶
type ScimUser struct {
ID string `json:"id"`
ExternalID *string `json:"externalId,omitempty"`
UserName string `json:"userName"`
DisplayName *string `json:"displayName,omitempty"`
Active bool `json:"active"`
Emails []ScimEmail `json:"emails"`
Meta ScimUserMeta `json:"meta"`
}
ScimUser represents a SCIM-provisioned user.
type ScimUserMeta ¶
type ScimUserMeta struct {
ResourceType string `json:"resourceType"`
Created string `json:"created"`
LastModified string `json:"lastModified"`
}
ScimUserMeta is SCIM user metadata.
type SignupParams ¶
SignupParams are the parameters for developer registration.
type SignupResponse ¶
type SignupResponse struct {
DeveloperID string `json:"developerId"`
APIKey string `json:"apiKey"`
Name string `json:"name"`
Email *string `json:"email"`
Mode string `json:"mode"`
CreatedAt string `json:"createdAt"`
}
SignupResponse is returned from Signup.
func Signup ¶
func Signup(ctx context.Context, params SignupParams, opts ...Option) (*SignupResponse, error)
Signup registers a new developer account. This is a static operation that does not require an API key.
type SsoCallbackResponse ¶
type SsoCallbackResponse struct {
Email *string `json:"email"`
Name *string `json:"name"`
Sub *string `json:"sub"`
DeveloperID string `json:"developerId"`
}
SsoCallbackResponse is the response from handling an SSO callback. Deprecated: Use SsoCallbackResult for enterprise SSO.
type SsoCallbackResult ¶ added in v0.1.4
type SsoCallbackResult struct {
SessionID string `json:"sessionId"`
Email *string `json:"email"`
Name *string `json:"name"`
Sub *string `json:"sub"`
Groups []string `json:"groups"`
MappedScopes []string `json:"mappedScopes"`
PrincipalID *string `json:"principalId"`
DeveloperID string `json:"developerId"`
ExpiresAt string `json:"expiresAt"`
}
SsoCallbackResult is the result from an enterprise SSO callback (OIDC, SAML, or LDAP).
type SsoConfig ¶
type SsoConfig struct {
IssuerURL string `json:"issuerUrl"`
ClientID string `json:"clientId"`
RedirectURI string `json:"redirectUri"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
}
SsoConfig represents an SSO configuration.
type SsoConnection ¶ added in v0.1.4
type SsoConnection struct {
ID string `json:"id"`
DeveloperID string `json:"developerId"`
Name string `json:"name"`
Protocol string `json:"protocol"`
Status string `json:"status"`
IssuerURL string `json:"issuerUrl,omitempty"`
ClientID string `json:"clientId,omitempty"`
IdpEntityID string `json:"idpEntityId,omitempty"`
IdpSsoURL string `json:"idpSsoUrl,omitempty"`
SpEntityID string `json:"spEntityId,omitempty"`
SpAcsURL string `json:"spAcsUrl,omitempty"`
LdapURL string `json:"ldapUrl,omitempty"`
LdapBindDN string `json:"ldapBindDn,omitempty"`
LdapSearchBase string `json:"ldapSearchBase,omitempty"`
LdapSearchFilter string `json:"ldapSearchFilter,omitempty"`
LdapGroupSearchBase string `json:"ldapGroupSearchBase,omitempty"`
LdapGroupSearchFilter string `json:"ldapGroupSearchFilter,omitempty"`
LdapTlsEnabled bool `json:"ldapTlsEnabled,omitempty"`
Domains []string `json:"domains"`
JitProvisioning bool `json:"jitProvisioning"`
Enforce bool `json:"enforce"`
GroupAttribute string `json:"groupAttribute,omitempty"`
GroupMappings map[string][]string `json:"groupMappings"`
DefaultScopes []string `json:"defaultScopes"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
}
SsoConnection represents an enterprise SSO connection (OIDC, SAML, or LDAP).
type SsoConnectionTestResult ¶ added in v0.1.4
type SsoConnectionTestResult struct {
Success bool `json:"success"`
Protocol string `json:"protocol"`
Issuer string `json:"issuer,omitempty"`
Error string `json:"error,omitempty"`
Details []string `json:"details,omitempty"`
}
SsoConnectionTestResult is the result of testing an SSO connection.
type SsoEnforcementParams ¶ added in v0.1.4
type SsoEnforcementParams struct {
Enforce bool `json:"enforce"`
}
SsoEnforcementParams are the parameters for configuring SSO enforcement.
type SsoEnforcementResponse ¶ added in v0.1.4
type SsoEnforcementResponse struct {
Enforce bool `json:"enforce"`
DeveloperID string `json:"developerId"`
}
SsoEnforcementResponse is the response from setting SSO enforcement.
type SsoLdapCallbackParams ¶ added in v0.1.4
type SsoLdapCallbackParams struct {
Username string `json:"username"`
Password string `json:"password"`
ConnectionID string `json:"connectionId"`
Org string `json:"org"`
}
SsoLdapCallbackParams are the parameters for handling an LDAP SSO callback.
type SsoLoginResponse ¶
type SsoLoginResponse struct {
AuthorizeURL string `json:"authorizeUrl"`
}
SsoLoginResponse is the response from getting an SSO login URL.
type SsoOidcCallbackParams ¶ added in v0.1.4
type SsoOidcCallbackParams struct {
Code string `json:"code"`
State string `json:"state"`
RedirectURI string `json:"redirect_uri,omitempty"`
}
SsoOidcCallbackParams are the parameters for handling an OIDC SSO callback.
type SsoSamlCallbackParams ¶ added in v0.1.4
type SsoSamlCallbackParams struct {
SAMLResponse string `json:"SAMLResponse"`
RelayState string `json:"RelayState"`
}
SsoSamlCallbackParams are the parameters for handling a SAML SSO callback.
type SsoSession ¶ added in v0.1.4
type SsoSession struct {
ID string `json:"id"`
DeveloperID string `json:"developerId"`
ConnectionID string `json:"connectionId"`
Email string `json:"email"`
ExpiresAt string `json:"expiresAt"`
CreatedAt string `json:"createdAt"`
}
SsoSession represents an active SSO session.
type StoreCredentialParams ¶ added in v0.1.4
type StoreCredentialParams struct {
PrincipalID string `json:"principalId"`
Service string `json:"service"`
CredentialType string `json:"credentialType,omitempty"`
AccessToken string `json:"accessToken"`
RefreshToken string `json:"refreshToken,omitempty"`
TokenExpiresAt string `json:"tokenExpiresAt,omitempty"`
Metadata map[string]interface{} `json:"metadata,omitempty"`
}
StoreCredentialParams contains the parameters for storing a credential in the vault.
type StoreCredentialResponse ¶ added in v0.1.4
type StoreCredentialResponse struct {
ID string `json:"id"`
PrincipalID string `json:"principalId"`
Service string `json:"service"`
CredentialType string `json:"credentialType"`
CreatedAt string `json:"createdAt"`
}
StoreCredentialResponse is the response from storing a credential.
type SubscriptionStatus ¶
type SubscriptionStatus struct {
Plan string `json:"plan"`
Status string `json:"status"`
CurrentPeriodEnd *string `json:"currentPeriodEnd"`
}
SubscriptionStatus represents the current subscription.
type TokenError ¶
TokenError represents a token verification or decoding error.
func (*TokenError) Error ¶
func (e *TokenError) Error() string
func (*TokenError) Unwrap ¶
func (e *TokenError) Unwrap() error
type TokensService ¶
type TokensService struct {
// contains filtered or unexported fields
}
TokensService handles token exchange, refresh, verification, and revocation.
func (*TokensService) Exchange ¶
func (s *TokensService) Exchange(ctx context.Context, params ExchangeTokenParams) (*ExchangeTokenResponse, error)
Exchange trades an authorization code for a grant token.
func (*TokensService) Refresh ¶
func (s *TokensService) Refresh(ctx context.Context, params RefreshTokenParams) (*ExchangeTokenResponse, error)
Refresh exchanges a refresh token for a new grant token.
func (*TokensService) Revoke ¶
func (s *TokensService) Revoke(ctx context.Context, tokenID string) error
Revoke revokes a token by its ID.
func (*TokensService) Verify ¶
func (s *TokensService) Verify(ctx context.Context, token string) (*VerifyTokenResponse, error)
Verify performs online token verification.
type TransactionAmount ¶ added in v0.1.4
TransactionAmount represents a monetary amount with currency.
type UpdateAgentParams ¶
type UpdateAgentParams struct {
Name *string `json:"name,omitempty"`
Description *string `json:"description,omitempty"`
Scopes []string `json:"scopes,omitempty"`
}
UpdateAgentParams are the parameters for updating an agent.
type UpdatePolicyParams ¶
type UpdatePolicyParams struct {
Name *string `json:"name,omitempty"`
Effect *string `json:"effect,omitempty"`
Priority *int `json:"priority,omitempty"`
AgentID *string `json:"agentId,omitempty"`
PrincipalID *string `json:"principalId,omitempty"`
Scopes []string `json:"scopes,omitempty"`
TimeOfDayStart *string `json:"timeOfDayStart,omitempty"`
TimeOfDayEnd *string `json:"timeOfDayEnd,omitempty"`
}
UpdatePolicyParams are the parameters for updating a policy.
type UpdateSsoConnectionParams ¶ added in v0.1.4
type UpdateSsoConnectionParams struct {
Name *string `json:"name,omitempty"`
Status *string `json:"status,omitempty"`
IssuerURL *string `json:"issuerUrl,omitempty"`
ClientID *string `json:"clientId,omitempty"`
ClientSecret *string `json:"clientSecret,omitempty"`
IdpEntityID *string `json:"idpEntityId,omitempty"`
IdpSsoURL *string `json:"idpSsoUrl,omitempty"`
IdpCertificate *string `json:"idpCertificate,omitempty"`
LdapURL *string `json:"ldapUrl,omitempty"`
LdapBindDN *string `json:"ldapBindDn,omitempty"`
LdapBindPassword *string `json:"ldapBindPassword,omitempty"`
LdapSearchBase *string `json:"ldapSearchBase,omitempty"`
LdapSearchFilter *string `json:"ldapSearchFilter,omitempty"`
LdapGroupSearchBase *string `json:"ldapGroupSearchBase,omitempty"`
LdapGroupSearchFilter *string `json:"ldapGroupSearchFilter,omitempty"`
LdapTlsEnabled *bool `json:"ldapTlsEnabled,omitempty"`
Domains []string `json:"domains,omitempty"`
JitProvisioning *bool `json:"jitProvisioning,omitempty"`
GroupAttribute *string `json:"groupAttribute,omitempty"`
GroupMappings *map[string][]string `json:"groupMappings,omitempty"`
DefaultScopes []string `json:"defaultScopes,omitempty"`
}
UpdateSsoConnectionParams are the parameters for updating an SSO connection.
type UsageHistoryEntry ¶ added in v0.1.3
type UsageHistoryEntry struct {
Date string `json:"date"`
TokenExchanges int `json:"tokenExchanges"`
Authorizations int `json:"authorizations"`
Verifications int `json:"verifications"`
TotalRequests int `json:"totalRequests"`
}
UsageHistoryEntry represents a single day's usage metrics.
type UsageResponse ¶ added in v0.1.3
type UsageResponse struct {
DeveloperID string `json:"developerId"`
Period string `json:"period"`
TokenExchanges int `json:"tokenExchanges"`
Authorizations int `json:"authorizations"`
Verifications int `json:"verifications"`
TotalRequests int `json:"totalRequests"`
}
UsageResponse represents the current usage metrics.
type UsageService ¶ added in v0.1.3
type UsageService struct {
// contains filtered or unexported fields
}
UsageService handles usage metering operations.
func (*UsageService) Current ¶ added in v0.1.3
func (s *UsageService) Current(ctx context.Context) (*UsageResponse, error)
Current retrieves the current period's usage metrics.
func (*UsageService) History ¶ added in v0.1.3
func (s *UsageService) History(ctx context.Context, days int) ([]UsageHistoryEntry, error)
History retrieves usage history for the specified number of days.
type VCVerificationResult ¶ added in v0.1.3
type VCVerificationResult struct {
Valid bool `json:"valid"`
CredentialSubject map[string]interface{} `json:"credentialSubject"`
Issuer string `json:"issuer"`
Error string `json:"error,omitempty"`
}
VCVerificationResult is the result of verifying a Verifiable Credential.
type VaultCredential ¶ added in v0.1.4
type VaultCredential struct {
ID string `json:"id"`
PrincipalID string `json:"principalId"`
Service string `json:"service"`
CredentialType string `json:"credentialType"`
TokenExpiresAt *string `json:"tokenExpiresAt"`
Metadata map[string]interface{} `json:"metadata"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
}
VaultCredential represents a credential record in the vault.
type VaultService ¶ added in v0.1.4
type VaultService struct {
// contains filtered or unexported fields
}
VaultService handles credential vault operations.
func (*VaultService) Delete ¶ added in v0.1.4
func (s *VaultService) Delete(ctx context.Context, credentialID string) error
Delete removes a credential from the vault.
func (*VaultService) Exchange ¶ added in v0.1.4
func (s *VaultService) Exchange(ctx context.Context, grantToken string, params ExchangeCredentialParams) (*ExchangeCredentialResponse, error)
Exchange trades a grant token for an upstream service credential. Unlike other methods, this uses the grant token (not the API key) as the Bearer token.
func (*VaultService) Get ¶ added in v0.1.4
func (s *VaultService) Get(ctx context.Context, credentialID string) (*VaultCredential, error)
Get retrieves credential metadata by ID (no raw token).
func (*VaultService) List ¶ added in v0.1.4
func (s *VaultService) List(ctx context.Context, params *ListVaultCredentialsParams) ([]VaultCredential, error)
List retrieves credential metadata (no raw tokens).
func (*VaultService) Store ¶ added in v0.1.4
func (s *VaultService) Store(ctx context.Context, params StoreCredentialParams) (*StoreCredentialResponse, error)
Store saves an encrypted credential in the vault (upserts on principal+service).
type VerifiableCredentialRecord ¶ added in v0.1.3
type VerifiableCredentialRecord struct {
ID string `json:"id"`
Type []string `json:"type"`
Issuer string `json:"issuer"`
Subject string `json:"subject"`
GrantID string `json:"grantId"`
Status string `json:"status"`
IssuanceDate string `json:"issuanceDate"`
JWT string `json:"jwt"`
}
VerifiableCredentialRecord represents a Verifiable Credential record.
type VerifiedGrant ¶
type VerifiedGrant struct {
TokenID string `json:"tokenId"`
GrantID string `json:"grantId"`
PrincipalID string `json:"principalId"`
AgentDID string `json:"agentDid"`
DeveloperID string `json:"developerId"`
Scopes []string `json:"scopes"`
IssuedAt int64 `json:"issuedAt"`
ExpiresAt int64 `json:"expiresAt"`
ParentAgentDID *string `json:"parentAgentDid,omitempty"`
ParentGrantID *string `json:"parentGrantId,omitempty"`
DelegationDepth *int `json:"delegationDepth,omitempty"`
}
VerifiedGrant represents a verified JWT grant token's claims.
func VerifyGrantToken ¶
func VerifyGrantToken(ctx context.Context, token string, opts VerifyOptions) (*VerifiedGrant, error)
VerifyGrantToken performs local JWT verification using JWKS retrieved from JwksURI. It verifies the RS256 signature, expiration, issuer, required grant claims, and optionally checks required scopes and audience.
type VerifyDomainResponse ¶ added in v0.1.3
type VerifyDomainResponse struct {
Verified bool `json:"verified"`
}
VerifyDomainResponse is the response from a domain verification operation.
type VerifyOptions ¶
type VerifyOptions struct {
// JwksURI is the URL to fetch the JSON Web Key Set from.
JwksURI string
// Issuer is the expected issuer claim. When empty, it is derived from
// IssuerDID or JwksURI. The hosted Grantex JWKS maps to https://grantex.dev.
Issuer string
// IssuerDID resolves a did:web identifier to its JWKS URL and issuer.
// It takes precedence over JwksURI when set to a did:web value.
IssuerDID string
// RequiredScopes are scopes the token must contain. If empty, scope checking is skipped.
RequiredScopes []string
// Audience is the expected audience claim. If empty, audience checking is skipped.
Audience string
// ClockTolerance allows for clock skew between servers. Defaults to 0.
ClockTolerance time.Duration
}
VerifyOptions configures local grant token verification using remotely retrieved JWKS.
type VerifyTokenResponse ¶
type VerifyTokenResponse struct {
Valid bool `json:"valid"`
GrantID *string `json:"grantId,omitempty"`
Scopes []string `json:"scopes,omitempty"`
Principal *string `json:"principal,omitempty"`
Agent *string `json:"agent,omitempty"`
ExpiresAt *string `json:"expiresAt,omitempty"`
}
VerifyTokenResponse is the response from online token verification.
type WebAuthnCredential ¶ added in v0.1.3
type WebAuthnCredential struct {
ID string `json:"id"`
CredentialID string `json:"credentialId"`
PublicKey string `json:"publicKey"`
Counter int `json:"counter"`
Transports []string `json:"transports"`
CreatedAt string `json:"createdAt"`
}
WebAuthnCredential represents a registered FIDO2 credential.
type WebAuthnRegisterOptionsParams ¶ added in v0.1.3
type WebAuthnRegisterOptionsParams struct {
PrincipalID string `json:"principalId"`
}
WebAuthnRegisterOptionsParams contains the parameters for requesting registration options.
type WebAuthnRegisterVerifyParams ¶ added in v0.1.3
type WebAuthnRegisterVerifyParams struct {
ChallengeID string `json:"challengeId"`
Response interface{} `json:"response"`
}
WebAuthnRegisterVerifyParams contains the parameters for verifying a registration response.
type WebAuthnRegistrationOptions ¶ added in v0.1.3
type WebAuthnRegistrationOptions struct {
ChallengeID string `json:"challengeId"`
Options map[string]interface{} `json:"options"`
}
WebAuthnRegistrationOptions contains the challenge and options for WebAuthn registration.
type WebAuthnService ¶ added in v0.1.3
type WebAuthnService struct {
// contains filtered or unexported fields
}
WebAuthnService handles FIDO2/WebAuthn credential management.
func (*WebAuthnService) DeleteCredential ¶ added in v0.1.3
func (s *WebAuthnService) DeleteCredential(ctx context.Context, id string) error
DeleteCredential removes a WebAuthn credential by ID.
func (*WebAuthnService) ListCredentials ¶ added in v0.1.3
func (s *WebAuthnService) ListCredentials(ctx context.Context, principalID string) ([]WebAuthnCredential, error)
ListCredentials lists all WebAuthn credentials for a principal.
func (*WebAuthnService) RegisterOptions ¶ added in v0.1.3
func (s *WebAuthnService) RegisterOptions(ctx context.Context, params WebAuthnRegisterOptionsParams) (*WebAuthnRegistrationOptions, error)
RegisterOptions requests WebAuthn registration options for a principal.
func (*WebAuthnService) RegisterVerify ¶ added in v0.1.3
func (s *WebAuthnService) RegisterVerify(ctx context.Context, params WebAuthnRegisterVerifyParams) (*WebAuthnCredential, error)
RegisterVerify verifies a WebAuthn registration response.
type WebhookEndpoint ¶
type WebhookEndpoint struct {
ID string `json:"id"`
URL string `json:"url"`
Events []string `json:"events"`
CreatedAt string `json:"createdAt"`
}
WebhookEndpoint represents a webhook endpoint.
type WebhookEndpointWithSecret ¶
type WebhookEndpointWithSecret struct {
ID string `json:"id"`
URL string `json:"url"`
Events []string `json:"events"`
CreatedAt string `json:"createdAt"`
Secret string `json:"secret"`
}
WebhookEndpointWithSecret is a webhook endpoint that includes the signing secret.
type WebhooksService ¶
type WebhooksService struct {
// contains filtered or unexported fields
}
WebhooksService handles webhook endpoint management.
func (*WebhooksService) Create ¶
func (s *WebhooksService) Create(ctx context.Context, params CreateWebhookParams) (*WebhookEndpointWithSecret, error)
Create registers a new webhook endpoint.
func (*WebhooksService) Delete ¶
func (s *WebhooksService) Delete(ctx context.Context, webhookID string) error
Delete removes a webhook endpoint.
func (*WebhooksService) List ¶
func (s *WebhooksService) List(ctx context.Context) (*ListWebhooksResponse, error)
List retrieves all webhook endpoints.
type WithdrawConsentParams ¶ added in v0.1.10
type WithdrawConsentParams struct {
Reason string `json:"reason"`
RevokeGrant bool `json:"revokeGrant,omitempty"`
DeleteProcessedData bool `json:"deleteProcessedData,omitempty"`
}
WithdrawConsentParams contains the parameters for withdrawing consent.
type WithdrawConsentResponse ¶ added in v0.1.10
type WithdrawConsentResponse struct {
RecordID string `json:"recordId"`
Status string `json:"status"`
WithdrawnAt string `json:"withdrawnAt"`
GrantRevoked bool `json:"grantRevoked"`
DataDeleted bool `json:"dataDeleted"`
}
WithdrawConsentResponse is the result of withdrawing consent.