gnap

package module
v0.0.0-...-e279f7d Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2022 License: Apache-2.0 Imports: 7 Imported by: 5

Documentation

Index

Constants

View Source
const (
	Bearer  AccessFlag = "bearer"
	Durable            = "durable"
	Split              = "split"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessFlag

type AccessFlag string

type AccessToken

type AccessToken struct {
	Value   string        `json:"value,omitempty"`
	Label   string        `json:"label,omitempty"`
	Manage  string        `json:"manage,omitempty"`
	Access  []TokenAccess `json:"access,omitempty"`
	Expires int64         `json:"expires_in,omitempty"` // integer value in seconds.
	Key     string        `json:"key,omitempty"`
	Flags   []AccessFlag  `json:"flags,omitempty"`
}

AccessToken https://www.ietf.org/archive/id/draft-ietf-gnap-core-protocol-09.html#section-3.2.1

type AuthRequest

type AuthRequest struct {
	// TODO: single TokenRequest is treated like a slice of one element.
	AccessToken []*TokenRequest  `json:"access_token,omitempty"`
	Client      *RequestClient   `json:"client,omitempty"`
	Interact    *RequestInteract `json:"interact,omitempty"`
}

AuthRequest https://www.ietf.org/archive/id/draft-ietf-gnap-core-protocol-09.html#section-2

func (*AuthRequest) MarshalJSON

func (a *AuthRequest) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (*AuthRequest) UnmarshalJSON

func (a *AuthRequest) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler..

type AuthResponse

type AuthResponse struct {
	Continue    ResponseContinue `json:"continue,omitempty"`
	AccessToken []AccessToken    `json:"access_token,omitempty"`
	Interact    ResponseInteract `json:"interact,omitempty"`
	InstanceID  string           `json:"instance_id,omitempty"`
	Subject     Subject          `json:"subject,omitempty"`
}

AuthResponse https://www.ietf.org/archive/id/draft-ietf-gnap-core-protocol-09.html#section-3

type ClientKey

type ClientKey struct {
	Proof string  `json:"proof"`
	JWK   jwk.JWK `json:"jwk"`
}

ClientKey https://www.ietf.org/archive/id/draft-ietf-gnap-core-protocol-09.html#section-7.1.1

type ContinueRequest

type ContinueRequest struct {
	InteractRef string `json:"interact_ref"`
}

ContinueRequest https://www.ietf.org/archive/id/draft-ietf-gnap-core-protocol-09.html#section-5.1

type ErrorResponse

type ErrorResponse struct {
	Error       string `json:"error"`
	Description string `json:"error_description,omitempty"`
}

ErrorResponse https://www.ietf.org/archive/id/draft-ietf-gnap-core-protocol-09.html#section-3.6

type IntrospectRequest

type IntrospectRequest struct {
	AccessToken    string         `json:"access_token"`
	Proof          string         `json:"proof"`
	Access         []TokenAccess  `json:"access,omitempty"`
	ResourceServer *RequestClient `json:"resource_server,omitempty"`
}

IntrospectRequest https://www.ietf.org/archive/id/draft-ietf-gnap-resource-servers-01.html#section-3.3

type IntrospectResponse

type IntrospectResponse struct {
	Active      bool              `json:"active"`
	Access      []TokenAccess     `json:"access,omitempty"`
	Key         *ClientKey        `json:"key,omitempty"`
	Flags       []AccessFlag      `json:"flags,omitempty"`
	SubjectData map[string]string `json:"subject_data,omitempty"`
}

IntrospectResponse https://www.ietf.org/archive/id/draft-ietf-gnap-resource-servers-01.html#section-3.3

type RequestClient

type RequestClient struct {
	IsReference bool
	Ref         string
	Key         *ClientKey `json:"key"`
}

RequestClient https://www.ietf.org/archive/id/draft-ietf-gnap-core-protocol-09.html#section-2.3

func (*RequestClient) MarshalJSON

func (r *RequestClient) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (*RequestClient) UnmarshalJSON

func (r *RequestClient) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

type RequestFinish

type RequestFinish struct {
	Method string `json:"method"`
	URI    string `json:"uri"`
	Nonce  string `json:"nonce"`
}

RequestFinish https://www.ietf.org/archive/id/draft-ietf-gnap-core-protocol-09.html#section-2.5.2

type RequestInteract

type RequestInteract struct {
	Start  []string      `json:"start"`
	Finish RequestFinish `json:"finish"`
}

RequestInteract https://www.ietf.org/archive/id/draft-ietf-gnap-core-protocol-09.html#section-2.5

type ResponseContinue

type ResponseContinue struct {
	URI         string      `json:"uri,omitempty"`
	AccessToken AccessToken `json:"access_token,omitempty"`
	Wait        int         `json:"wait,omitempty"`
}

ResponseContinue https://www.ietf.org/archive/id/draft-ietf-gnap-core-protocol-09.html#section-3.1

type ResponseInteract

type ResponseInteract struct {
	Redirect string `json:"redirect,omitempty"`
	Finish   string `json:"finish,omitempty"`
}

ResponseInteract https://www.ietf.org/archive/id/draft-ietf-gnap-core-protocol-09.html#section-3.3

type Signer

type Signer interface {
	ProofType() string
	Sign(request *http.Request, requestBody []byte) (*http.Request, error)
}

Signer api for GNAP http signatures.

type Subject

type Subject struct {
	SubIDs     []SubjectID        `json:"sub_ids,omitempty"`
	Assertions []SubjectAssertion `json:"assertions,omitempty"`
}

Subject https://www.ietf.org/archive/id/draft-ietf-gnap-core-protocol-09.html#section-3.4

type SubjectAssertion

type SubjectAssertion struct {
	Value  string `json:"value,omitempty"`
	Format string `json:"format,omitempty"`
}

SubjectAssertion https://www.ietf.org/archive/id/draft-ietf-gnap-core-protocol-09.html#section-3.4

type SubjectID

type SubjectID struct {
	ID     string `json:"id,omitempty"`
	Format string `json:"format,omitempty"`
}

SubjectID https://www.ietf.org/archive/id/draft-ietf-secevent-subject-identifiers-09.txt

type TokenAccess

type TokenAccess struct {
	IsReference bool
	Ref         string
	Type        string `json:"type"`
	Raw         json.RawMessage
}

TokenAccess represents a GNAP token access descriptor, either as a string reference or as an object.

see: https://www.ietf.org/archive/id/draft-ietf-gnap-core-protocol-09.html#section-8

func (*TokenAccess) MarshalJSON

func (t *TokenAccess) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler.

func (*TokenAccess) UnmarshalJSON

func (t *TokenAccess) UnmarshalJSON(data []byte) error

UnmarshalJSON implements json.Unmarshaler.

type TokenRequest

type TokenRequest struct {
	Access []TokenAccess `json:"access"`
	Label  string        `json:"label,omitempty"`
	Flags  []AccessFlag  `json:"flags,omitempty"`
}

TokenRequest https://www.ietf.org/archive/id/draft-ietf-gnap-core-protocol-09.html#section-2.1

Directories

Path Synopsis
internal
proof

Jump to

Keyboard shortcuts

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