access

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2024 License: BSD-3-Clause-Clear Imports: 34 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrPolicyDissemInvalid = Error("policy dissem invalid")
	ErrDecisionUnexpected  = Error("access policy decision unexpected")
)
View Source
const (
	ErrAttributeDefinitionsUnmarshal   = Error("attribute definitions unmarshal")
	ErrAttributeDefinitionsServiceCall = Error("attribute definitions service call unexpected")
)
View Source
const (
	ErrCertificateEncode = Error("certificate encode error")
	ErrPublicKeyMarshal  = Error("public key marshal error")
)
View Source
const (
	ErrPolicyDataAttributeParse = Error("policy data attribute invalid")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Attribute

type Attribute struct {
	URI           string           `json:"attribute"` // attribute
	PublicKey     crypto.PublicKey `json:"pubKey"`    // pubKey
	ProviderURI   string           `json:"kasUrl"`    // kasUrl
	SchemaVersion string           `json:"tdf_spec_version,omitempty"`
	Name          string           `json:"displayName"` // displayName
}

type Body

type Body struct {
	DataAttributes []Attribute `json:"dataAttributes"`
	Dissem         []string    `json:"dissem"`
}

type ClaimsObject

type ClaimsObject struct {
	PublicKey              string        `json:"public_key"`
	ClientPublicSigningKey string        `json:"client_public_signing_key"`
	SchemaVersion          string        `json:"tdf_spec_version,omitempty"`
	Entitlements           []Entitlement `json:"entitlements"`
}

type Entitlement

type Entitlement struct {
	EntityID         string      `json:"entity_identifier"`
	EntityAttributes []Attribute `json:"entity_attributes"`
}

type Error

type Error string

func (Error) Error

func (e Error) Error() string

type Policy

type Policy struct {
	UUID uuid.UUID `json:"uuid"`
	Body Body      `json:"body"`
}

type Provider

type Provider struct {
	URI          url.URL `json:"uri"`
	PrivateKey   p11.Pkcs11PrivateKeyRSA
	PublicKeyRsa rsa.PublicKey `json:"publicKey"`
	PublicKeyEc  ecdsa.PublicKey
	Certificate  x509.Certificate `json:"certificate"`
	Attributes   []Attribute      `json:"attributes"`
	Session      p11.Pkcs11Session
	OIDCVerifier *oidc.IDTokenVerifier
}

func (*Provider) CertificateHandler

func (p *Provider) CertificateHandler(w http.ResponseWriter, r *http.Request)

func (*Provider) Handler

func (p *Provider) Handler(w http.ResponseWriter, r *http.Request)

Handler decrypts and encrypts the symmetric data key

func (*Provider) HealthZ added in v0.1.1

func (p *Provider) HealthZ(w http.ResponseWriter, r *http.Request)

func (*Provider) PublicKeyHandlerV2

func (p *Provider) PublicKeyHandlerV2(w http.ResponseWriter, r *http.Request)

PublicKeyHandlerV2 decrypts and encrypts the symmetric data key

func (*Provider) Version added in v0.1.1

func (p *Provider) Version(w http.ResponseWriter, r *http.Request)

type RequestBody

type RequestBody struct {
	AuthToken       string         `json:"authToken"`
	KeyAccess       tdf3.KeyAccess `json:"keyAccess"`
	Policy          string         `json:"policy,omitempty"`
	Algorithm       string         `json:"algorithm,omitempty"`
	ClientPublicKey string         `json:"clientPublicKey"`
	SchemaVersion   string         `json:"schemaVersion,omitempty"`
}

type RewrapRequest

type RewrapRequest struct {
	SignedRequestToken string `json:"signedRequestToken"`
}

type RewrapResponse

type RewrapResponse struct {
	EntityWrappedKey []byte `json:"entityWrappedKey"`
	SessionPublicKey string `json:"sessionPublicKey"`
	SchemaVersion    string `json:"schemaVersion,omitempty"`
}

Jump to

Keyboard shortcuts

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