Documentation
¶
Index ¶
- Constants
- type BearerTokenStore
- type GetOauthTokenInput
- type GetOauthTokenOutput
- type Option
- type RestClient
- func (c *RestClient) GetComputerByID(ctx context.Context, id string) (*model.Computer, error)
- func (c *RestClient) GetGroupByID(ctx context.Context, id string) (*model.GroupItem, error)
- func (c *RestClient) GetIntegrationByID(ctx context.Context, id string) (*model.Integration, error)
- func (c *RestClient) GetMonitorByID(ctx context.Context, id string) (*model.Monitor, error)
- func (c *RestClient) GetPersonByID(ctx context.Context, id string) (*model.Person, error)
- func (c *RestClient) GetPolicyByID(ctx context.Context, id string) (*model.PolicyItem, error)
- func (c *RestClient) GetTestByID(ctx context.Context, id string) (*model.Test, error)
- func (c *RestClient) GetVendorByID(ctx context.Context, id string) (*model.Vendor, error)
- func (c *RestClient) GetVulnerabilityByID(ctx context.Context, id string) (*model.Vulnerability, error)
- func (c *RestClient) ListComputers(ctx context.Context, options *model.ListComputersOptions) (*model.ListComputersOutput, error)
- func (c *RestClient) ListConnectedIntegrations(ctx context.Context, options *model.ListIntegrationsOptions) (*model.ListIntegrationsOutput, error)
- func (c *RestClient) ListEvidence(ctx context.Context, auditID string, options *model.ListEvidenceOptions) (*model.ListEvidenceOutput, error)
- func (c *RestClient) ListGroups(ctx context.Context, options *model.ListGroupsOptions) (*model.ListGroupsOutput, error)
- func (c *RestClient) ListMonitors(ctx context.Context, options *model.ListMonitorsOptions) (*model.MonitorResults, error)
- func (c *RestClient) ListPeople(ctx context.Context, options *model.ListPeopleOptions) (*model.ListPeopleOutput, error)
- func (c *RestClient) ListPolicies(ctx context.Context, options *model.ListPoliciesOptions) (*model.ListPoliciesOutput, error)
- func (c *RestClient) ListTestEntities(ctx context.Context, testID string, options *model.ListTestEntitiesOptions) (*model.TestEntitiesResults, error)
- func (c *RestClient) ListTests(ctx context.Context, options *model.ListTestsOptions) (*model.TestResults, error)
- func (c *RestClient) ListVendors(ctx context.Context, options *model.ListVendorsOptions) (*model.ListVendorsOutput, error)
- func (c *RestClient) ListVulnerabilities(ctx context.Context, options *model.ListVulnerabilitiesOptions) (*model.ListVulnerabilitiesOutput, error)
- func (c *RestClient) SetHTTPClient(client *http.Client)
- type StaticTokenStore
- type TokenStore
- type Vanta
Constants ¶
const (
ScopeAllRead = "vanta-api.all:read"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BearerTokenStore ¶
type BearerTokenStore struct {
*StaticTokenStore
}
BearerTokenStore is a convenience wrapper for Bearer token authentication
func NewBearerTokenStore ¶
func NewBearerTokenStore(token string) *BearerTokenStore
NewBearerTokenStore creates a new Bearer token store
func (*BearerTokenStore) SetBearerToken ¶
func (b *BearerTokenStore) SetBearerToken(token string)
SetBearerToken updates the Bearer token
type GetOauthTokenInput ¶
type GetOauthTokenInput struct {
ClientID string `json:"client_id"`
ClientSecret string `json:"client_secret"`
Scope string `json:"scope"`
GrantType string `json:"grant_type"`
}
GetOauthTokenInput represents the OAuth token request
type GetOauthTokenOutput ¶
type GetOauthTokenOutput struct {
AccessToken string `json:"access_token"`
TokenType string `json:"token_type"`
ExpiresIn int `json:"expires_in"`
Scope string `json:"scope"`
}
GetOauthTokenOutput represents the OAuth token response
type Option ¶
type Option func(*vanta)
Option represents a functional option for configuring the client
func WithBaseURL ¶
WithBaseURL sets the base URL for the Vanta API
func WithHTTPClient ¶
WithHTTPClient sets a custom HTTP client
func WithOAuthCredentials ¶
WithOAuthCredentials sets OAuth client credentials for automatic token refresh
func WithScopes ¶
WithScopes sets the OAuth scopes for the client
type RestClient ¶
type RestClient struct {
// contains filtered or unexported fields
}
RestClient wraps the Vanta API client with additional functionality
func NewRestClient ¶
func NewRestClient(baseURL string, tokenStore TokenStore) *RestClient
NewRestClient creates a new REST client instance
func (*RestClient) GetComputerByID ¶
GetComputerByID retrieves a specific computer by its ID
func (*RestClient) GetGroupByID ¶
GetGroupByID retrieves a specific group by its ID
func (*RestClient) GetIntegrationByID ¶
func (c *RestClient) GetIntegrationByID(ctx context.Context, id string) (*model.Integration, error)
GetIntegrationByID retrieves a specific integration by its ID
func (*RestClient) GetMonitorByID ¶
GetMonitorByID retrieves a specific monitor/test by its ID
func (*RestClient) GetPersonByID ¶
GetPersonByID retrieves a specific person by their ID
func (*RestClient) GetPolicyByID ¶
func (c *RestClient) GetPolicyByID(ctx context.Context, id string) (*model.PolicyItem, error)
GetPolicyByID retrieves a specific policy by its ID
func (*RestClient) GetTestByID ¶
GetTestByID retrieves a specific comprehensive test by its ID
func (*RestClient) GetVendorByID ¶
GetVendorByID retrieves a specific vendor by its ID
func (*RestClient) GetVulnerabilityByID ¶ added in v2.2.0
func (c *RestClient) GetVulnerabilityByID(ctx context.Context, id string) (*model.Vulnerability, error)
GetVulnerabilityByID retrieves a specific vulnerability by its ID
func (*RestClient) ListComputers ¶
func (c *RestClient) ListComputers(ctx context.Context, options *model.ListComputersOptions) (*model.ListComputersOutput, error)
ListComputers retrieves a paginated list of computers from Vanta
func (*RestClient) ListConnectedIntegrations ¶
func (c *RestClient) ListConnectedIntegrations(ctx context.Context, options *model.ListIntegrationsOptions) (*model.ListIntegrationsOutput, error)
ListConnectedIntegrations retrieves a paginated list of integrations from Vanta
func (*RestClient) ListEvidence ¶
func (c *RestClient) ListEvidence(ctx context.Context, auditID string, options *model.ListEvidenceOptions) (*model.ListEvidenceOutput, error)
ListEvidence retrieves a list of evidence for a specific audit
func (*RestClient) ListGroups ¶
func (c *RestClient) ListGroups(ctx context.Context, options *model.ListGroupsOptions) (*model.ListGroupsOutput, error)
ListGroups retrieves a paginated list of groups from Vanta
func (*RestClient) ListMonitors ¶
func (c *RestClient) ListMonitors(ctx context.Context, options *model.ListMonitorsOptions) (*model.MonitorResults, error)
ListMonitors retrieves a paginated list of monitors/tests from Vanta
func (*RestClient) ListPeople ¶
func (c *RestClient) ListPeople(ctx context.Context, options *model.ListPeopleOptions) (*model.ListPeopleOutput, error)
ListPeople retrieves a paginated list of people from Vanta
func (*RestClient) ListPolicies ¶
func (c *RestClient) ListPolicies(ctx context.Context, options *model.ListPoliciesOptions) (*model.ListPoliciesOutput, error)
ListPolicies retrieves a paginated list of policies from Vanta
func (*RestClient) ListTestEntities ¶
func (c *RestClient) ListTestEntities(ctx context.Context, testID string, options *model.ListTestEntitiesOptions) (*model.TestEntitiesResults, error)
ListTestEntities retrieves a paginated list of entities for a specific test
func (*RestClient) ListTests ¶
func (c *RestClient) ListTests(ctx context.Context, options *model.ListTestsOptions) (*model.TestResults, error)
ListTests retrieves a paginated list of comprehensive tests from Vanta
func (*RestClient) ListVendors ¶
func (c *RestClient) ListVendors(ctx context.Context, options *model.ListVendorsOptions) (*model.ListVendorsOutput, error)
ListVendors retrieves a paginated list of vendors from Vanta
func (*RestClient) ListVulnerabilities ¶ added in v2.2.0
func (c *RestClient) ListVulnerabilities(ctx context.Context, options *model.ListVulnerabilitiesOptions) (*model.ListVulnerabilitiesOutput, error)
ListVulnerabilities retrieves a paginated list of vulnerabilities from Vanta
func (*RestClient) SetHTTPClient ¶
func (c *RestClient) SetHTTPClient(client *http.Client)
SetHTTPClient allows setting a custom HTTP client
type StaticTokenStore ¶
type StaticTokenStore struct {
// contains filtered or unexported fields
}
StaticTokenStore implements TokenStore for static token authentication
func NewStaticTokenStore ¶
func NewStaticTokenStore(tokenType, token string) *StaticTokenStore
NewStaticTokenStore creates a new static token store
func (*StaticTokenStore) GetToken ¶
func (s *StaticTokenStore) GetToken() (string, string)
GetToken returns the stored token
func (*StaticTokenStore) SetToken ¶
func (s *StaticTokenStore) SetToken(tokenType, token string)
SetToken updates the stored token
type TokenStore ¶
type TokenStore interface {
GetToken() (tokenType, token string)
}
TokenStore interface for managing authentication tokens
type Vanta ¶
type Vanta interface {
ListPeople(ctx context.Context, options *model.ListPeopleOptions) (*model.ListPeopleOutput, error)
GetPersonByID(ctx context.Context, id string) (*model.Person, error)
ListPolicies(ctx context.Context, options *model.ListPoliciesOptions) (*model.ListPoliciesOutput, error)
GetPolicyByID(ctx context.Context, id string) (*model.PolicyItem, error)
ListGroups(ctx context.Context, options *model.ListGroupsOptions) (*model.ListGroupsOutput, error)
GetGroupByID(ctx context.Context, id string) (*model.GroupItem, error)
ListConnectedIntegrations(ctx context.Context, options *model.ListIntegrationsOptions) (*model.ListIntegrationsOutput, error)
GetIntegrationByID(ctx context.Context, id string) (*model.Integration, error)
ListComputers(ctx context.Context, options *model.ListComputersOptions) (*model.ListComputersOutput, error)
GetComputerByID(ctx context.Context, id string) (*model.Computer, error)
ListVendors(ctx context.Context, options *model.ListVendorsOptions) (*model.ListVendorsOutput, error)
GetVendorByID(ctx context.Context, id string) (*model.Vendor, error)
ListMonitors(ctx context.Context, options *model.ListMonitorsOptions) (*model.MonitorResults, error)
GetMonitorByID(ctx context.Context, id string) (*model.Monitor, error)
ListTestEntities(ctx context.Context, testID string, options *model.ListTestEntitiesOptions) (*model.TestEntitiesResults, error)
// Comprehensive Test API methods
ListTests(ctx context.Context, options *model.ListTestsOptions) (*model.TestResults, error)
GetTestByID(ctx context.Context, id string) (*model.Test, error)
// Evidence API methods
ListEvidence(ctx context.Context, auditID string, options *model.ListEvidenceOptions) (*model.ListEvidenceOutput, error)
// Vulnerability API methods
ListVulnerabilities(ctx context.Context, options *model.ListVulnerabilitiesOptions) (*model.ListVulnerabilitiesOutput, error)
GetVulnerabilityByID(ctx context.Context, id string) (*model.Vulnerability, error)
SetHTTPClient(client *http.Client)
}
Vanta interface defines the methods available on the client