flowinfo

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: May 23, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CommunicationData

type CommunicationData struct {
	Comms []ReqRes
}

CommunicationData represents the data exchange during http communication.

func (*CommunicationData) Add

func (c *CommunicationData) Add(name string, req *http.Request, res *http.Response, reqBody, resBody string)

Add adds an entry with request and response data from an http.Request and http.Response to the CommunicationData

func (*CommunicationData) AddRequest

func (c *CommunicationData) AddRequest(name string, req *http.Request, reqBody string)

AddRequest adds a new entry with the request data from an http.Request to the CommunicationData

func (*CommunicationData) AddResponseToLast

func (c *CommunicationData) AddResponseToLast(res *http.Response, resBody string)

AddResponseToLast adds the response data from an http.Response to the last entry in CommunicationData

func (*CommunicationData) Format

func (c *CommunicationData) Format() string

Format formats the CommunicationData into a string.

func (*CommunicationData) FormatHTML

func (c *CommunicationData) FormatHTML()

FormatHTML formats the CommunicationData into an html string. This also redacts client credentials.

func (*CommunicationData) Redact

func (c *CommunicationData) Redact()

Redact redacts CommunicationData, i.e. it redacts all OIDC tokens.

type Context

type Context struct {
	ClientConfig *provider.ClientConfig `json:"client_config,omitempty"`
	Comm         *CommunicationData     `json:"communication,omitempty"`
}

Context holds the ClientConfig and CommunicationData context.

func (*Context) MarshalBinary

func (c *Context) MarshalBinary() ([]byte, error)

MarshalBinary marshals Context into bytes.

func (*Context) UnmarshalBinary

func (c *Context) UnmarshalBinary(data []byte) error

UnmarshalBinary unmarshalls bytes into Context.

type FlowInfo

type FlowInfo struct {
	FlowName string
	OIDCInfo
	Communication    CommunicationData
	CacheTimeMinutes uint64
}

FlowInfo represents the information about an OIDC flow run.

func (FlowInfo) MarshalBinary

func (c FlowInfo) MarshalBinary() ([]byte, error)

MarshalBinary marshals FlowInfo into bytes.

func (*FlowInfo) Store

func (c *FlowInfo) Store(lifetime uint64) (string, error)

Store stores the FlowInfo for the given time

func (*FlowInfo) UnmarshalBinary

func (c *FlowInfo) UnmarshalBinary(data []byte) error

UnmarshalBinary unmarshalls bytes into FlowInfo.

type HBod

type HBod struct {
	Header string
	Body   string
}

HBod hold a formatted header and body.

type IDTokenVerificationStatus

type IDTokenVerificationStatus struct {
	NotMalformed bool `json:"not_malformed" html:"Token not malformed"`
	Signature    bool `json:"signature_verified" html:"Signature verified"`
	Audience     bool `json:"audience_verified" html:"Audience verified"`
	Issuer       bool `json:"issuer_verified" html:"Issuer verified"`
	NotExpired   bool `json:"not_expired" html:"Token not expired yet"`
	AlreadyValid bool `json:"already_valid" html:"Token already valid"`
	ATHash       bool `json:"at_hash_verified" html:"Access Token hash verified"`
}

IDTokenVerificationStatus represents the verification status of an id token.

type OIDCInfo

type OIDCInfo struct {
	IDTokenClaims             jwt.MapClaims
	IDTokenVerificationStatus *IDTokenVerificationStatus
	ATClaims                  jwt.MapClaims
	UserInfo                  jwt.MapClaims
}

OIDCInfo represents OIDC information displayed as part of a FlowInfo

func (OIDCInfo) ATClaimsHTML

func (c OIDCInfo) ATClaimsHTML() string

ATClaimsHTML returns an html representation of the ATClaims

func (*OIDCInfo) ConvertFloats

func (c *OIDCInfo) ConvertFloats()

ConvertFloats converts any float64 in any of the maps to an integer value

func (OIDCInfo) IDTokenClaimsHTML

func (c OIDCInfo) IDTokenClaimsHTML() string

IDTokenClaimsHTML returns an html representation of the IDTokenClaims

func (OIDCInfo) IDTokenVerificationStatusHTML

func (c OIDCInfo) IDTokenVerificationStatusHTML() string

IDTokenVerificationStatusHTML returns an html representation of the IDTokenVerificationStatus

func (OIDCInfo) MarshalBinary

func (c OIDCInfo) MarshalBinary() ([]byte, error)

MarshalBinary marshals OIDCInfo into bytes.

func (*OIDCInfo) UnmarshalBinary

func (c *OIDCInfo) UnmarshalBinary(data []byte) error

UnmarshalBinary unmarshalls bytes into OIDCInfo.

func (OIDCInfo) UserInfoHTML

func (c OIDCInfo) UserInfoHTML() string

UserInfoHTML returns an html representation of the UserInfo

type ReqRes

type ReqRes struct {
	Name     string
	Request  HBod
	Response HBod
}

ReqRes is a named request response communication data pair.

func NewReqRes

func NewReqRes(req *http.Request, res *http.Response, name string) ReqRes

NewReqRes creates a new ReqRes from an http.Request and http.Response

Jump to

Keyboard shortcuts

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