assertion

package
v0.0.0-...-1643d90 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2020 License: UPL-1.0 Imports: 12 Imported by: 0

Documentation

Overview

Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved. Licensed under the Universal Permissive License (UPL) Version 1.0 as shown at http://oss.oracle.com/licenses/upl.

Index

Constants

View Source
const (
	// TokenKey http header key name for asserting token
	TokenKey = "x-token"
	// IdpTypeKey http header key name for idp
	IdpTypeKey = "x-idp"
	// AllowedIDDKey http header key name for allowed IDD
	AllowedIDDKey = "x-allowedIDD"
	// RequestHeaderKey http header key name for extra headers which will be passed to IDP
	RequestHeaderKey = "x-ecid"
)

Variables

This section is empty.

Functions

func NewTestServer

func NewTestServer(tb testing.TB, handlers map[string]http.Handler) *httptest.Server

Types

type AssertResponse

type AssertResponse struct {
	Principals []*adsapi.Principal    `json:"principals,omitempty"`
	Attributes map[string]interface{} `json:"attributes,omitempty"`
	ErrCode    int                    `json:"errCode"`
	ErrMessage string                 `json:"errMessage,omitempty"`
}

AssertResponse assertion response

type AsserterConfig

type AsserterConfig struct {
	Endpoint    string `json:"endpoint"`
	CACert      string `json:"caCert"`
	ClientCert  string `json:"clientCert"`
	ClientKey   string `json:"clientKey"`
	HTTPTimeout int    `json:"httpTimeout"`
}

AsserterConfig asserter webhook client configuration

type TokenAsserter

type TokenAsserter interface {
	// AssertToken assert token and generate subject to represent the identity
	AssertToken(token string, idpType string, allowedIDD string, requestHeaders map[string]string) (*AssertResponse, error)
}

TokenAsserter asserter interface

func NewAsserter

func NewAsserter(conf *AsserterConfig, tenant *string) (TokenAsserter, error)

NewAsserter create asserter webhook client

type WebHookAsserter

type WebHookAsserter struct {
	ServerEndpoint string
	// contains filtered or unexported fields
}

WebHookAsserter implements asserter client interface

func (*WebHookAsserter) AssertToken

func (a *WebHookAsserter) AssertToken(token string, idpType string, allowedIDD string, requestHeaders map[string]string) (*AssertResponse, error)

AssertToken assert token via webhook

Jump to

Keyboard shortcuts

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