model

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AttrScope      = "scope"
	AttrAud        = "audience"
	AttrCapability = "capability"
)

Defined attributes

Variables

View Source
var AllRestrictionClaimStrings = api.AllRestrictionClaims

AllRestrictionClaimStrings holds all defined RestrictionClaim strings

Attributes holds all defined attributes

View Source
var ResponseNYI = Response{
	Status:   fiber.StatusNotImplemented,
	Response: api.ErrorNYI,
}

ResponseNYI is the server response when something is not yet implemented

Functions

This section is empty.

Types

type Response

type Response struct {
	// The Http Status code of the response
	Status int
	// The response body, will be marshalled as json
	Response interface{}
	// Cookies that should be set
	Cookies []*fiber.Cookie
}

Response models a http server response

func ErrorToBadRequestErrorResponse

func ErrorToBadRequestErrorResponse(err error) *Response

ErrorToBadRequestErrorResponse creates a bad request error response from a golang error

func ErrorToInternalServerErrorResponse

func ErrorToInternalServerErrorResponse(err error) *Response

ErrorToInternalServerErrorResponse creates an internal server error response from a golang error

func (Response) Send

func (r Response) Send(ctx *fiber.Ctx) error

Send sends this response using the passed fiber.Ctx

type RestrictionClaim added in v0.5.0

type RestrictionClaim int

RestrictionClaim is an enum like type for restriction keys

const (
	RestrictionClaimNotBefore RestrictionClaim = iota
	RestrictionClaimExpiresAt
	RestrictionClaimScope
	RestrictionClaimAudiences
	RestrictionClaimHosts
	RestrictionClaimGeoIPAllow
	RestrictionClaimGeoIPDisallow
	RestrictionClaimUsagesAT
	RestrictionClaimUsagesOther
)

RestrictionClaims

func NewRestrictionClaim added in v0.5.0

func NewRestrictionClaim(s string) RestrictionClaim

NewRestrictionClaim creates a new RestrictionClaim from the grant type string

func (RestrictionClaim) MarshalJSON added in v0.5.0

func (rc RestrictionClaim) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface

func (*RestrictionClaim) String added in v0.5.0

func (rc *RestrictionClaim) String() string

func (*RestrictionClaim) UnmarshalJSON added in v0.5.0

func (rc *RestrictionClaim) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface

func (*RestrictionClaim) UnmarshalText added in v0.5.0

func (rc *RestrictionClaim) UnmarshalText(data []byte) error

UnmarshalText implements the encoding.TextUnmarshaler interface

func (*RestrictionClaim) UnmarshalYAML added in v0.5.0

func (rc *RestrictionClaim) UnmarshalYAML(value *yaml.Node) error

UnmarshalYAML implements the yaml.Unmarshaler interface

func (*RestrictionClaim) Valid added in v0.5.0

func (rc *RestrictionClaim) Valid() bool

Valid checks that RestrictionClaim is a defined grant type

type RestrictionClaims added in v0.5.0

type RestrictionClaims []RestrictionClaim

RestrictionClaims is a slice of RestrictionClaim

var AllRestrictionClaims RestrictionClaims

AllRestrictionClaims holds all defined RestrictionClaims

func (RestrictionClaims) Disable added in v0.5.0

func (rks RestrictionClaims) Disable(disable RestrictionClaims) (left RestrictionClaims)

Disable subtracts the passed RestrictionClaims from this RestrictionClaims and returns the left RestrictionClaims

func (RestrictionClaims) Has added in v0.5.0

Has checks if a RestrictionClaim is in a RestrictionClaims

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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