paths

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 9, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	IDPBasePath = "/authn" // TODO change this

	// TODO: finish converting IDP path handling to use these
	CreateUser     = fmt.Sprintf("%s/users", IDPBasePath)
	AddAuthnToUser = fmt.Sprintf("%s/addauthntouser", IDPBasePath)

	UserStoreBasePath = "/userstore"

	BaseConfigPath = fmt.Sprintf("%s/config", UserStoreBasePath)

	BaseConfigColumnsPath = fmt.Sprintf("%s/columns", BaseConfigPath)

	CreateColumnPath = BaseConfigColumnsPath
	DeleteColumnPath = singleConfigColumnPath
	GetColumnPath    = singleConfigColumnPath
	ListColumnsPath  = BaseConfigColumnsPath
	UpdateColumnPath = singleConfigColumnPath

	BaseConfigAccessorPath = fmt.Sprintf("%s/accessors", BaseConfigPath)

	CreateAccessorPath       = BaseConfigAccessorPath
	DeleteAccessorPath       = singleConfigAccessorPath
	GetAccessorPath          = singleConfigAccessorPath
	GetAccessorByVersionPath = versionedSingleConfigAccessorPath
	ListAccessorsPath        = BaseConfigAccessorPath
	UpdateAccessorPath       = singleConfigAccessorPath

	BaseAccessorPath    = fmt.Sprintf("%s/accessors", BaseAPIPath)
	ExecuteAccessorPath = BaseAccessorPath

	BaseConfigMutatorPath = fmt.Sprintf("%s/mutators", BaseConfigPath)

	CreateMutatorPath       = BaseConfigMutatorPath
	DeleteMutatorPath       = singleConfigMutatorPath
	GetMutatorPath          = singleConfigMutatorPath
	GetMutatorByVersionPath = versionedSingleConfigMutatorPath
	ListMutatorsPath        = BaseConfigMutatorPath
	UpdateMutatorPath       = singleConfigMutatorPath

	BaseMutatorPath    = fmt.Sprintf("%s/mutators", BaseAPIPath)
	ExecuteMutatorPath = BaseMutatorPath

	BaseConfigPurposePath = fmt.Sprintf("%s/purposes", BaseConfigPath)

	CreatePurposePath = BaseConfigPurposePath
	ListPurposesPath  = BaseConfigPurposePath
	GetPurposePath    = singleConfigPurposePath
	DeletePurposePath = singleConfigPurposePath
	UpdatePurposePath = singleConfigPurposePath

	CreateUserWithMutatorPath       = fmt.Sprintf("%s/users", BaseAPIPath)
	GetConsentedPurposesForUserPath = fmt.Sprintf("%s/consentedpurposes", BaseAPIPath)

	BaseAPIPath = fmt.Sprintf("%s/api", UserStoreBasePath)

	TokenizerBasePath = "/tokenizer"

	BaseTokenPath        = fmt.Sprintf("%s/tokens", TokenizerBasePath)
	CreateToken          = BaseTokenPath
	DeleteToken          = BaseTokenPath
	ResolveToken         = fmt.Sprintf("%s/actions/resolve", BaseTokenPath)
	InspectToken         = fmt.Sprintf("%s/actions/inspect", BaseTokenPath)
	LookupToken          = fmt.Sprintf("%s/actions/lookup", BaseTokenPath)
	LookupOrCreateTokens = fmt.Sprintf("%s/actions/lookuporcreate", BaseTokenPath)

	BasePolicyPath = fmt.Sprintf("%s/policies", TokenizerBasePath)

	BaseAccessPolicyPath  = fmt.Sprintf("%s/access", BasePolicyPath)
	ListAccessPolicies    = BaseAccessPolicyPath
	GetAccessPolicyByName = func(name string) string {
		return fmt.Sprintf("%s?policy_name=%s", BaseAccessPolicyPath, name)
	}
	GetAccessPolicyByNameAndVersion = func(name string, version int) string {
		return fmt.Sprintf("%s?policy_name=%s&policy_version=%d", BaseAccessPolicyPath, name, version)
	}
	GetAccessPolicy = func(id uuid.UUID) string {
		return fmt.Sprintf("%s/%s", BaseAccessPolicyPath, id)
	}
	GetAccessPolicyByVersion = func(id uuid.UUID, version int) string {
		return fmt.Sprintf("%s/%s?policy_version=%d", BaseAccessPolicyPath, id, version)
	}
	CreateAccessPolicy = BaseAccessPolicyPath
	UpdateAccessPolicy = func(id uuid.UUID) string { return fmt.Sprintf("%s/%s", BaseAccessPolicyPath, id) }
	DeleteAccessPolicy = func(id uuid.UUID, version int) string {
		return fmt.Sprintf("%s/%s?policy_version=%d", BaseAccessPolicyPath, id, version)
	}
	DeleteAllAccessPolicyVersions = func(id uuid.UUID) string {
		return fmt.Sprintf("%s/%s?policy_version=all", BaseAccessPolicyPath, id)
	}
	TestAccessPolicy    = fmt.Sprintf("%s/actions/test", BaseAccessPolicyPath)
	ExecuteAccessPolicy = fmt.Sprintf("%s/actions/execute", BaseAccessPolicyPath)

	BaseAccessPolicyTemplatePath  = fmt.Sprintf("%s/accesstemplate", BasePolicyPath)
	ListAccessPolicyTemplates     = BaseAccessPolicyTemplatePath
	GetAccessPolicyTemplateByName = func(name string) string {
		return fmt.Sprintf("%s?template_name=%s", BaseAccessPolicyTemplatePath, name)
	}
	GetAccessPolicyTemplateByNameAndVersion = func(name string, version int) string {
		return fmt.Sprintf("%s?template_name=%s&template_version=%d", BaseAccessPolicyTemplatePath, name, version)
	}
	GetAccessPolicyTemplate = func(id uuid.UUID) string {
		return fmt.Sprintf("%s/%s", BaseAccessPolicyTemplatePath, id)
	}
	GetAccessPolicyTemplateByVersion = func(id uuid.UUID, version int) string {
		return fmt.Sprintf("%s/%s?template_version=%d", BaseAccessPolicyTemplatePath, id, version)
	}
	CreateAccessPolicyTemplate = BaseAccessPolicyTemplatePath
	UpdateAccessPolicyTemplate = func(id uuid.UUID) string { return fmt.Sprintf("%s/%s", BaseAccessPolicyTemplatePath, id) }
	DeleteAccessPolicyTemplate = func(id uuid.UUID, version int) string {
		return fmt.Sprintf("%s/%s?template_version=%d", BaseAccessPolicyTemplatePath, id, version)
	}
	DeleteAllAccessPolicyTemplateVersions = func(id uuid.UUID) string {
		return fmt.Sprintf("%s/%s?template_version=all", BaseAccessPolicyTemplatePath, id)
	}
	TestAccessPolicyTemplate = fmt.Sprintf("%s/actions/test", BaseAccessPolicyTemplatePath)

	BaseTransformerPath  = fmt.Sprintf("%s/transformation", BasePolicyPath)
	ListTransformers     = BaseTransformerPath
	GetTransformerByName = func(name string) string {
		return fmt.Sprintf("%s?transformer_name=%s", BaseTransformerPath, name)
	}
	GetTransformer = func(id uuid.UUID) string {
		return fmt.Sprintf("%s/%s", BaseTransformerPath, id)
	}
	CreateTransformer  = BaseTransformerPath
	DeleteTransformer  = func(id uuid.UUID) string { return fmt.Sprintf("%s/%s", BaseTransformerPath, id) }
	TestTransformer    = fmt.Sprintf("%s/actions/test", BaseTransformerPath)
	ExecuteTransformer = fmt.Sprintf("%s/actions/execute", BaseTransformerPath)

	BaseDataMappingPath = "/userstore/datamapping"

	CreateDataSourcePath = fmt.Sprintf("%s/datasource", BaseDataMappingPath)

	DeleteDataSourcePath = singleDataSourcePath
	GetDataSourcePath    = singleDataSourcePath
	UpdateDataSourcePath = singleDataSourcePath
	ListDataSourcesPath  = CreateDataSourcePath

	CreateDataSourceElementPath = fmt.Sprintf("%s/element", BaseDataMappingPath)

	DeleteDataSourceElementPath = singleDataSourceElementPath
	GetDataSourceElementPath    = singleDataSourceElementPath
	UpdateDataSourceElementPath = singleDataSourceElementPath
	ListDataSourceElementsPath  = CreateDataSourceElementPath

	DownloadGolangSDKPath     = fmt.Sprintf("%s/download/codegensdk.go", UserStoreBasePath)
	DownloadPythonSDKPath     = fmt.Sprintf("%s/download/codegensdk.py", UserStoreBasePath)
	DownloadTypescriptSDKPath = fmt.Sprintf("%s/download/codegensdk.ts", UserStoreBasePath)

	ExternalOIDCIssuersPath = fmt.Sprintf("%s/oidcissuers", UserStoreBasePath)
)

Path constants for the userstore

View Source
var DataTypePath = fmt.Sprintf("%s/%s", BaseConfigPath, "datatypes")

DataTypePath is the path constant for interacting with data types

Functions

func DataTypePathForID added in v1.2.0

func DataTypePathForID(dataTypeID uuid.UUID) string

DataTypePathForID returns the data type path for a specific data type id

func GetReferenceURLForAccessPolicy added in v0.6.4

func GetReferenceURLForAccessPolicy(id uuid.UUID, v int) string

GetReferenceURLForAccessPolicy return URL pointing at a particular access policy object

func GetReferenceURLForAccessor added in v0.4.0

func GetReferenceURLForAccessor(id uuid.UUID, v int) string

GetReferenceURLForAccessor return URL pointing at a particular access policy object

func GetReferenceURLForMutator added in v0.4.0

func GetReferenceURLForMutator(id uuid.UUID, v int) string

GetReferenceURLForMutator return URL pointing at a particular transformer object

func GetReferenceURLForTransformer added in v0.6.4

func GetReferenceURLForTransformer(id uuid.UUID, v int) string

GetReferenceURLForTransformer return URL pointing at a particular transformer object

func StripTokenizerBase added in v0.6.4

func StripTokenizerBase(path string) string

StripTokenizerBase makes the URLs functional for handler setup

func StripUserstoreBase added in v0.6.4

func StripUserstoreBase(path string) string

StripUserstoreBase makes the URLs functional for handler setup

Types

type RetentionPath added in v0.7.2

type RetentionPath struct {
	// contains filtered or unexported fields
}

RetentionPath manages building a path for interacting with retention durations

func NewRetentionPath added in v0.7.2

func NewRetentionPath(isLive bool) *RetentionPath

NewRetentionPath creates a new retention path

func (*RetentionPath) Build added in v0.7.2

func (rp *RetentionPath) Build() string

Build returns a path string for the retention path

func (*RetentionPath) ForColumn added in v0.7.2

func (rp *RetentionPath) ForColumn(columnID uuid.UUID) *RetentionPath

ForColumn configures the retention path to be for a column

func (*RetentionPath) ForDuration added in v0.7.2

func (rp *RetentionPath) ForDuration(durationID uuid.UUID) *RetentionPath

ForDuration configures the retention path to be for a duration ID

func (*RetentionPath) ForPurpose added in v0.7.2

func (rp *RetentionPath) ForPurpose(purposeID uuid.UUID) *RetentionPath

ForPurpose configures the retention path to be for a purpose

func (*RetentionPath) ForTenant added in v0.7.2

func (rp *RetentionPath) ForTenant() *RetentionPath

ForTenant configures the retention path to be for a tenant

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL