Documentation ¶
Index ¶
- Constants
- Variables
- func NewUserFilterInput(filter *UsersFilter) *query.UserFilterInput
- func WithCallerCtx(ctx context.Context, caller string) context.Context
- type APIError
- type AccessInput
- type Client
- func (client *Client) AddResourceAccess(ctx context.Context, resourceID string, access []AccessInput) error
- func (client *Client) CreateConnector(ctx context.Context, input *model.Connector) (*model.Connector, error)
- func (client *Client) CreateDNSFilteringProfile(ctx context.Context, name string) (*model.DNSFilteringProfile, error)
- func (client *Client) CreateGroup(ctx context.Context, input *model.Group) (*model.Group, error)
- func (client *Client) CreateRemoteNetwork(ctx context.Context, req *model.RemoteNetwork) (*model.RemoteNetwork, error)
- func (client *Client) CreateResource(ctx context.Context, input *model.Resource) (*model.Resource, error)
- func (client *Client) CreateServiceAccount(ctx context.Context, serviceAccountName string) (*model.ServiceAccount, error)
- func (client *Client) CreateServiceKey(ctx context.Context, serviceAccountKey *model.ServiceKey) (*model.ServiceKey, error)
- func (client *Client) CreateUser(ctx context.Context, input *model.User) (*model.User, error)
- func (client *Client) DeleteConnector(ctx context.Context, connectorID string) error
- func (client *Client) DeleteDNSFilteringProfile(ctx context.Context, profileID string) error
- func (client *Client) DeleteGroup(ctx context.Context, groupID string) error
- func (client *Client) DeleteGroupUsers(ctx context.Context, groupID string, userIDs []string) error
- func (client *Client) DeleteRemoteNetwork(ctx context.Context, remoteNetworkID string) error
- func (client *Client) DeleteResource(ctx context.Context, resourceID string) error
- func (client *Client) DeleteServiceAccount(ctx context.Context, serviceAccountID string) error
- func (client *Client) DeleteServiceKey(ctx context.Context, serviceAccountKeyID string) error
- func (client *Client) DeleteUser(ctx context.Context, userID string) error
- func (client *Client) GenerateConnectorTokens(ctx context.Context, connectorID string) (*model.ConnectorTokens, error)
- func (client *Client) ReadConnector(ctx context.Context, connectorID string) (*model.Connector, error)
- func (client *Client) ReadConnectors(ctx context.Context, name, filter string) ([]*model.Connector, error)
- func (client *Client) ReadDNSFilteringProfile(ctx context.Context, profileID string) (*model.DNSFilteringProfile, error)
- func (client *Client) ReadFullGroups(ctx context.Context) ([]*model.Group, error)
- func (client *Client) ReadFullResources(ctx context.Context) ([]*model.Resource, error)
- func (client *Client) ReadGroup(ctx context.Context, groupID string) (*model.Group, error)
- func (client *Client) ReadGroups(ctx context.Context, filter *model.GroupsFilter) ([]*model.Group, error)
- func (client *Client) ReadRemoteNetwork(ctx context.Context, remoteNetworkID, remoteNetworkName string) (*model.RemoteNetwork, error)
- func (client *Client) ReadRemoteNetworkByID(ctx context.Context, remoteNetworkID string) (*model.RemoteNetwork, error)
- func (client *Client) ReadRemoteNetworkByName(ctx context.Context, remoteNetworkName string) (*model.RemoteNetwork, error)
- func (client *Client) ReadRemoteNetworks(ctx context.Context, name, filter string) ([]*model.RemoteNetwork, error)
- func (client *Client) ReadResource(ctx context.Context, resourceID string) (*model.Resource, error)
- func (client *Client) ReadResources(ctx context.Context) ([]*model.Resource, error)
- func (client *Client) ReadResourcesByName(ctx context.Context, name, filter string) ([]*model.Resource, error)
- func (client *Client) ReadSecurityPolicies(ctx context.Context, name, filter string) ([]*model.SecurityPolicy, error)
- func (client *Client) ReadSecurityPolicy(ctx context.Context, securityPolicyID, securityPolicyName string) (*model.SecurityPolicy, error)
- func (client *Client) ReadServiceAccount(ctx context.Context, serviceAccountID string) (*model.ServiceAccount, error)
- func (client *Client) ReadServiceAccounts(ctx context.Context, input ...string) ([]*model.ServiceAccount, error)
- func (client *Client) ReadServiceKey(ctx context.Context, serviceAccountKeyID string) (*model.ServiceKey, error)
- func (client *Client) ReadShallowDNSFilteringProfiles(ctx context.Context) ([]*model.DNSFilteringProfile, error)
- func (client *Client) ReadShallowServiceAccount(ctx context.Context, serviceAccountID string) (*model.ServiceAccount, error)
- func (client *Client) ReadShallowServiceAccounts(ctx context.Context) ([]*model.ServiceAccount, error)
- func (client *Client) ReadUser(ctx context.Context, userID string) (*model.User, error)
- func (client *Client) ReadUsers(ctx context.Context, filter *UsersFilter) ([]*model.User, error)
- func (client *Client) RemoveResourceAccess(ctx context.Context, resourceID string, principalIDs []string) error
- func (client *Client) RevokeServiceKey(ctx context.Context, serviceAccountKeyID string) error
- func (client *Client) UpdateConnector(ctx context.Context, input *model.Connector) (*model.Connector, error)
- func (client *Client) UpdateDNSFilteringProfile(ctx context.Context, input *model.DNSFilteringProfile) (*model.DNSFilteringProfile, error)
- func (client *Client) UpdateGroup(ctx context.Context, input *model.Group) (*model.Group, error)
- func (client *Client) UpdateRemoteNetwork(ctx context.Context, req *model.RemoteNetwork) (*model.RemoteNetwork, error)
- func (client *Client) UpdateResource(ctx context.Context, input *model.Resource) (*model.Resource, error)
- func (client *Client) UpdateResourceActiveState(ctx context.Context, resource *model.Resource) error
- func (client *Client) UpdateServiceAccount(ctx context.Context, serviceAccount *model.ServiceAccount) (*model.ServiceAccount, error)
- func (client *Client) UpdateServiceAccountRemoveResources(ctx context.Context, serviceAccountID string, resourceIDsToRemove []string) error
- func (client *Client) UpdateServiceKey(ctx context.Context, serviceAccountKey *model.ServiceKey) (*model.ServiceKey, error)
- func (client *Client) UpdateUser(ctx context.Context, input *model.UserUpdate) (*model.User, error)
- func (client *Client) UpdateUserRole(ctx context.Context, input *model.UserUpdate) (*model.User, error)
- func (client *Client) VerifyConnectorTokens(ctx context.Context, refreshToken, accessToken string) error
- type ContentCategoryConfigInput
- type DohFallbackMethod
- type HTTPError
- type MutationError
- type MutationResponse
- type PortRangeInput
- type PrivacyCategoryConfigInput
- type ProtocolInput
- type ProtocolsInput
- type RemoteNetworkLocation
- type RemoteNetworkType
- type ResponseWithPayload
- type SecurityCategoryConfigInput
- type StringFilter
- type UsersFilter
Constants ¶
View Source
const ( DefaultAgent = "TF" EnvPageLimit = "TWINGATE_PAGE_LIMIT" EnvAPIToken = "TWINGATE_API_TOKEN" // #nosec G101 EnvRateLimit = "TWINGATE_RATE_LIMIT" )
Variables ¶
View Source
var ( ErrGraphqlIDIsEmpty = errors.New("id is empty") ErrGraphqlNameIsEmpty = errors.New("name is empty") ErrGraphqlEmptyBothNameAndID = errors.New("both name and id should not be empty") ErrGraphqlResultIsEmpty = errors.New("query result is empty") ErrGraphqlConnectorIDIsEmpty = errors.New("connector id is empty") ErrGraphqlNetworkIDIsEmpty = errors.New("network id is empty") ErrGraphqlNetworkNameIsEmpty = errors.New("network name is empty") ErrGraphqlEmailIsEmpty = errors.New("email is empty") )
View Source
var (
ErrAPITokenNoSet = errors.New("api_token not set")
)
Functions ¶
func NewUserFilterInput ¶
func NewUserFilterInput(filter *UsersFilter) *query.UserFilterInput
Types ¶
type APIError ¶
type APIError struct { WrappedError error Operation string Resource string ID graphql.ID Name string }
func NewAPIError ¶
func NewAPIErrorWithID ¶
func NewAPIErrorWithName ¶
type AccessInput ¶
type Client ¶
type Client struct { GraphqlClient *graphql.Client HTTPClient *http.Client GraphqlServerURL string APIServerURL string // contains filtered or unexported fields }
func (*Client) AddResourceAccess ¶
func (*Client) CreateConnector ¶
func (*Client) CreateDNSFilteringProfile ¶ added in v3.0.11
func (*Client) CreateGroup ¶
func (*Client) CreateRemoteNetwork ¶
func (client *Client) CreateRemoteNetwork(ctx context.Context, req *model.RemoteNetwork) (*model.RemoteNetwork, error)
func (*Client) CreateResource ¶
func (*Client) CreateServiceAccount ¶
func (*Client) CreateServiceKey ¶
func (client *Client) CreateServiceKey(ctx context.Context, serviceAccountKey *model.ServiceKey) (*model.ServiceKey, error)
func (*Client) CreateUser ¶
func (*Client) DeleteConnector ¶
func (*Client) DeleteDNSFilteringProfile ¶ added in v3.0.11
func (*Client) DeleteGroup ¶
func (*Client) DeleteGroupUsers ¶
func (*Client) DeleteRemoteNetwork ¶
func (*Client) DeleteResource ¶
func (*Client) DeleteServiceAccount ¶
func (*Client) DeleteServiceKey ¶
func (*Client) DeleteUser ¶
func (*Client) GenerateConnectorTokens ¶
func (*Client) ReadConnector ¶
func (*Client) ReadConnectors ¶
func (*Client) ReadDNSFilteringProfile ¶ added in v3.0.11
func (*Client) ReadFullGroups ¶ added in v3.0.4
func (*Client) ReadFullResources ¶ added in v3.0.3
func (*Client) ReadGroups ¶
func (*Client) ReadRemoteNetwork ¶
func (*Client) ReadRemoteNetworkByID ¶
func (*Client) ReadRemoteNetworkByName ¶
func (*Client) ReadRemoteNetworks ¶
func (*Client) ReadResource ¶
func (*Client) ReadResources ¶
func (*Client) ReadResourcesByName ¶
func (*Client) ReadSecurityPolicies ¶
func (*Client) ReadSecurityPolicy ¶
func (*Client) ReadServiceAccount ¶
func (*Client) ReadServiceAccounts ¶
func (*Client) ReadServiceKey ¶
func (*Client) ReadShallowDNSFilteringProfiles ¶ added in v3.0.11
func (*Client) ReadShallowServiceAccount ¶
func (*Client) ReadShallowServiceAccounts ¶
func (*Client) RemoveResourceAccess ¶
func (*Client) RevokeServiceKey ¶
func (*Client) UpdateConnector ¶
func (*Client) UpdateDNSFilteringProfile ¶ added in v3.0.11
func (client *Client) UpdateDNSFilteringProfile(ctx context.Context, input *model.DNSFilteringProfile) (*model.DNSFilteringProfile, error)
func (*Client) UpdateGroup ¶
func (*Client) UpdateRemoteNetwork ¶
func (client *Client) UpdateRemoteNetwork(ctx context.Context, req *model.RemoteNetwork) (*model.RemoteNetwork, error)
func (*Client) UpdateResource ¶
func (*Client) UpdateResourceActiveState ¶
func (*Client) UpdateServiceAccount ¶
func (client *Client) UpdateServiceAccount(ctx context.Context, serviceAccount *model.ServiceAccount) (*model.ServiceAccount, error)
func (*Client) UpdateServiceAccountRemoveResources ¶
func (*Client) UpdateServiceKey ¶
func (client *Client) UpdateServiceKey(ctx context.Context, serviceAccountKey *model.ServiceKey) (*model.ServiceKey, error)
func (*Client) UpdateUser ¶
func (*Client) UpdateUserRole ¶
type ContentCategoryConfigInput ¶ added in v3.0.11
type ContentCategoryConfigInput struct { BlockAdultContent bool `json:"blockAdultContent"` BlockDating bool `json:"blockDating"` BlockGambling bool `json:"blockGambling"` BlockGames bool `json:"blockGames"` BlockPiracy bool `json:"blockPiracy"` BlockSocialMedia bool `json:"blockSocialMedia"` BlockStreaming bool `json:"blockStreaming"` EnableSafeSearch bool `json:"enableSafeSearch"` EnableYoutubeRestrictedMode bool `json:"enableYoutubeRestrictedMode"` }
type DohFallbackMethod ¶ added in v3.0.11
type DohFallbackMethod string
type MutationError ¶
type MutationError struct {
Message string
}
func NewMutationError ¶
func NewMutationError(message string) *MutationError
func (*MutationError) Error ¶
func (e *MutationError) Error() string
type MutationResponse ¶
type MutationResponse interface { OK() bool ErrorStr() string ResponseWithPayload }
type PortRangeInput ¶
type PrivacyCategoryConfigInput ¶ added in v3.0.11
type ProtocolInput ¶
type ProtocolInput struct { Ports []*PortRangeInput `json:"ports"` Policy string `json:"policy"` }
type ProtocolsInput ¶
type ProtocolsInput struct { UDP *ProtocolInput `json:"udp"` TCP *ProtocolInput `json:"tcp"` AllowIcmp bool `json:"allowIcmp"` }
type RemoteNetworkLocation ¶
type RemoteNetworkLocation string
type RemoteNetworkType ¶ added in v3.0.14
type RemoteNetworkType string
type ResponseWithPayload ¶
type ResponseWithPayload interface {
IsEmpty() bool
}
type SecurityCategoryConfigInput ¶ added in v3.0.11
type SecurityCategoryConfigInput struct { BlockCryptojacking bool `json:"blockCryptojacking"` BlockDNSRebinding bool `json:"blockDnsRebinding"` BlockDomainGenerationAlgorithms bool `json:"blockDomainGenerationAlgorithms"` BlockIdnHomographs bool `json:"blockIdnHomographs"` BlockNewlyRegisteredDomains bool `json:"blockNewlyRegisteredDomains"` BlockParkedDomains bool `json:"blockParkedDomains"` BlockTyposquatting bool `json:"blockTyposquatting"` EnableGoogleSafeBrowsing bool `json:"enableGoogleSafeBrowsing"` EnableThreatIntelligenceFeeds bool `json:"enableThreatIntelligenceFeeds"` }
type StringFilter ¶
type UsersFilter ¶
type UsersFilter struct { Email *StringFilter FirstName *StringFilter LastName *StringFilter Roles []string }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.