tokenizer

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateAccessPolicyRequest

type CreateAccessPolicyRequest struct {
	AccessPolicy policy.AccessPolicy `json:"access_policy"`
}

CreateAccessPolicyRequest creates a new AP

type CreateAccessPolicyTemplateRequest

type CreateAccessPolicyTemplateRequest struct {
	AccessPolicyTemplate policy.AccessPolicyTemplate `json:"access_policy_template"`
}

CreateAccessPolicyTemplateRequest creates a new AP Template

type CreateTokenRequest

type CreateTokenRequest struct {
	Data string `json:"data"`

	TransformerRID  userstore.ResourceID `json:"transformer_rid"`
	AccessPolicyRID userstore.ResourceID `json:"access_policy_rid"`
}

CreateTokenRequest is all the data needed to create a token

func (*CreateTokenRequest) Validate

func (o *CreateTokenRequest) Validate() error

Validate implements Validateable

type CreateTokenResponse

type CreateTokenResponse struct {
	Token string `json:"data"`
}

CreateTokenResponse is the response to a CreateToken call

type CreateTransformerRequest

type CreateTransformerRequest struct {
	Transformer policy.Transformer `json:"transformer"`
}

CreateTransformerRequest creates a new GP

type InspectTokenRequest

type InspectTokenRequest struct {
	Token string `json:"token"`
}

InspectTokenRequest contains the data required to inspect a token

func (InspectTokenRequest) Validate

func (i InspectTokenRequest) Validate() error

Validate implements Validateable

type InspectTokenResponse

type InspectTokenResponse struct {
	Token string `json:"token"`

	ID      uuid.UUID `json:"id"`
	Created time.Time `json:"created"`
	Updated time.Time `json:"updated"`

	AccessPolicy policy.AccessPolicy `json:"access_policy"`

	// TODO: should we embed this in AP always?
	CurrentAccessPolicyVersion int `json:"current_access_policy_version"`

	Transformer policy.Transformer `json:"transformer"`
}

InspectTokenResponse contains the data returned by an InspectToken call

type LookupOrCreateTokensRequest added in v0.7.1

type LookupOrCreateTokensRequest struct {
	Data []string `json:"data" validate:"skip"`

	TransformerRIDs  []userstore.ResourceID `json:"transformer_rids"`
	AccessPolicyRIDs []userstore.ResourceID `json:"access_policy_rids"`
}

LookupOrCreateTokensRequest contains the data required to lookup or create tokens in bulk

func (*LookupOrCreateTokensRequest) Validate added in v0.7.1

func (o *LookupOrCreateTokensRequest) Validate() error

Validate implements Validateable

type LookupOrCreateTokensResponse added in v0.7.1

type LookupOrCreateTokensResponse struct {
	Tokens []string `json:"tokens"`
}

LookupOrCreateTokensResponse contains the data returned by a LookupOrCreateTokens call

type LookupTokensRequest

type LookupTokensRequest struct {
	Data string `json:"data"`

	TransformerRID  userstore.ResourceID `json:"transformer_rid"`
	AccessPolicyRID userstore.ResourceID `json:"access_policy_rid"`
}

LookupTokensRequest contains the data required to lookup a token

func (*LookupTokensRequest) Validate

func (o *LookupTokensRequest) Validate() error

Validate implements Validateable

type LookupTokensResponse

type LookupTokensResponse struct {
	Tokens []string `json:"tokens"` // note that a single piece of data could tokenize many ways
}

LookupTokensResponse contains the data returned by a LookupToken call

type ResolveTokenResponse

type ResolveTokenResponse struct {
	Data  string `json:"data"`
	Token string `json:"token"` // include this in case it's helpful for correlating later?
}

ResolveTokenResponse is the response to a ResolveToken call

type ResolveTokensRequest

type ResolveTokensRequest struct {
	Tokens   []string               `json:"tokens"`
	Context  policy.ClientContext   `json:"context"`
	Purposes []userstore.ResourceID `json:"purposes"`
}

ResolveTokensRequest is the data needed to resolve a token

func (ResolveTokensRequest) Validate

func (r ResolveTokensRequest) Validate() error

Validate implements Validateable

type TestAccessPolicyRequest

type TestAccessPolicyRequest struct {
	AccessPolicy policy.AccessPolicy        `json:"access_policy"`
	Context      policy.AccessPolicyContext `json:"context"`
}

TestAccessPolicyRequest lets you run an unsaved policy with a given context for testing

type TestAccessPolicyResponse

type TestAccessPolicyResponse struct {
	Allowed bool `json:"allowed"`
}

TestAccessPolicyResponse is the response to a TestAccessPolicy call

type TestTransformerRequest

type TestTransformerRequest struct {
	Transformer policy.Transformer `json:"transformer"`
	Data        string             `json:"data"`
}

TestTransformerRequest lets you run an unsaved policy for testing

func (TestTransformerRequest) Validate

func (t TestTransformerRequest) Validate() error

Validate implements Validateable

type TestTransformerResponse

type TestTransformerResponse struct {
	Value string `json:"value"`
}

TestTransformerResponse is the response to a TestTransformer call

type UpdateAccessPolicyRequest

type UpdateAccessPolicyRequest struct {
	AccessPolicy policy.AccessPolicy `json:"access_policy"`
}

UpdateAccessPolicyRequest updates an AP by creating a new version

type UpdateAccessPolicyTemplateRequest

type UpdateAccessPolicyTemplateRequest struct {
	AccessPolicyTemplate policy.AccessPolicyTemplate `json:"access_policy_template"`
}

UpdateAccessPolicyTemplateRequest updates an AP Template

Jump to

Keyboard shortcuts

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