Documentation
¶
Index ¶
- Constants
- func ApplyCustomLogs(httpCtx *hcl.EvalContext, bodies []hcl.Body, logger *logrus.Entry) logrus.Fields
- func ApplyRequestContext(httpCtx *hcl.EvalContext, body *hclsyntax.Body, req *http.Request) error
- func ApplyResponseContext(ctx *hcl.EvalContext, body *hclsyntax.Body, beresp *http.Response) error
- func ApplyResponseHeaderOps(httpCtx *hcl.EvalContext, body hcl.Body, headers ...http.Header) error
- func ApplyResponseStatus(httpCtx *hcl.EvalContext, attr *hclsyntax.Attribute, beresp *http.Response) (int, error)
- func EvalCustomLogFields(httpCtx *hcl.EvalContext, body *hclsyntax.Body) (cty.Value, error)
- func GetBody(ctx *hcl.EvalContext, content *hclsyntax.Body) (string, string, error)
- func IsReservedContextName(name string) bool
- func IsUpgradeRequest(req *http.Request) bool
- func IsUpgradeResponse(req *http.Request, res *http.Response) bool
- func MapTokenResponse(evalCtx *hcl.EvalContext, name string)
- func NewRawOrigin(u *url.URL) *url.URL
- func SetBody(req *http.Request, body []byte)
- func SetGetBody(req *http.Request, bufferOpts buffer.Option, bodyLimit int64) error
- func SetHeader(val cty.Value, headerCtx http.Header)
- func Value(ctx *hcl.EvalContext, exp hcl.Expression) (cty.Value, error)
- func ValueFromBodyAttribute(ctx *hcl.EvalContext, body *hclsyntax.Body, name string) (cty.Value, error)
- type Context
- func (c *Context) Deadline() (deadline time.Time, ok bool)
- func (c *Context) Done() <-chan struct{}
- func (c *Context) Err() error
- func (c *Context) HCLContext() *hcl.EvalContext
- func (c *Context) HCLContextSync() *hcl.EvalContext
- func (c *Context) Value(key interface{}) interface{}
- func (c *Context) WithBeresp(beresp *http.Response, backendVal cty.Value) (*Context, string, cty.Value, cty.Value)
- func (c *Context) WithClientRequest(req *http.Request) *Context
- func (c *Context) WithContext(ctx context.Context) context.Context
- func (c *Context) WithJWTSigningConfigs(configs map[string]*lib.JWTSigningConfig) *Context
- func (c *Context) WithMemStore(store *cache.MemoryStore) *Context
- func (c *Context) WithOAuth2AC(os []*config.OAuth2AC) *Context
- func (c *Context) WithOidcConfig(confs oidc.Configs) *Context
- func (c *Context) WithSAML(s []*config.SAML) *Context
- type ContextMap
- type ReadCloser
- type SyncedVariables
- type ValueFunc
Constants ¶
const TokenRequestPrefix = "_tr_"
Variables ¶
This section is empty.
Functions ¶
func ApplyCustomLogs ¶
func ApplyRequestContext ¶
func ApplyResponseContext ¶
func ApplyResponseHeaderOps ¶
func ApplyResponseStatus ¶
func EvalCustomLogFields ¶
func IsReservedContextName ¶
func IsUpgradeRequest ¶
func MapTokenResponse ¶
func MapTokenResponse(evalCtx *hcl.EvalContext, name string)
func SetBody ¶
SetBody creates a reader from the given bytes for the Body itself and the request GetBody method. Since the size is known the Content-Length will be configured too.
func SetGetBody ¶
SetGetBody determines if we have to buffer a request body for further processing. First the user has a related reference within a related options' context declaration. Additionally, the request body is nil or a NoBody-Type and the http method has no http-body restrictions like 'TRACE'.
func Value ¶
Value is used to clone and modify the given expression if an expression would make use of undefined context variables. Effectively results in cty.NilVal or empty string value for template expression.
A common case would be accessing a deeper nested structure which MAY be incomplete. This replacement prevents returning unknown cty.Value's which could not be processed.
Types ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
func ContextFromRequest ¶
ContextFromRequest extracts the eval.Context implementation value from given request and returns a noop one as fallback.
func NewContext ¶
func NewDefaultContext ¶
func NewDefaultContext() *Context
func (*Context) HCLContext ¶
func (c *Context) HCLContext() *hcl.EvalContext
func (*Context) HCLContextSync ¶
func (c *Context) HCLContextSync() *hcl.EvalContext
func (*Context) WithBeresp ¶
func (*Context) WithJWTSigningConfigs ¶
func (c *Context) WithJWTSigningConfigs(configs map[string]*lib.JWTSigningConfig) *Context
WithJWTSigningConfigs initially sets up the lib.FnJWTSign function.
func (*Context) WithMemStore ¶
func (c *Context) WithMemStore(store *cache.MemoryStore) *Context
func (*Context) WithOAuth2AC ¶
WithOAuth2AC adds the OAuth2AC config structs.
func (*Context) WithOidcConfig ¶
WithOidcConfig adds the OidcConfig config structs.
type ContextMap ¶
func (ContextMap) Merge ¶
func (m ContextMap) Merge(other ContextMap) ContextMap
type ReadCloser ¶
func NewReadCloser ¶
func NewReadCloser(r io.Reader, c io.Closer) *ReadCloser
func (ReadCloser) Close ¶
func (rc ReadCloser) Close() error
type SyncedVariables ¶
type SyncedVariables struct {
// contains filtered or unexported fields
}
func NewSyncedVariables ¶
func NewSyncedVariables() *SyncedVariables
func (*SyncedVariables) SetResp ¶
func (sv *SyncedVariables) SetResp(beresp *http.Response)