requests

package
v1.0.23 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2022 License: Apache-2.0 Imports: 2 Imported by: 18

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthorizationRequest

type AuthorizationRequest struct {
	ID        string                `json:"id,omitempty" xml:"id,omitempty" yaml:"id,omitempty"`
	SessionID string                `json:"session_id,omitempty" xml:"session_id,omitempty" yaml:"session_id,omitempty"`
	Response  AuthorizationResponse `json:"response,omitempty" xml:"response,omitempty" yaml:"response,omitempty"`
	Redirect  RedirectResponse      `json:"-"`
	Token     AuthorizationToken    `json:"-"`
}

AuthorizationRequest hold the data associated with request authorization.

func NewAuthorizationRequest

func NewAuthorizationRequest() *AuthorizationRequest

NewAuthorizationRequest returns an instance of AuthorizationRequest.

type AuthorizationResponse

type AuthorizationResponse struct {
	User       map[string]interface{} `json:"-"`
	Authorized bool                   `json:"authorized" xml:"authorized" yaml:"authorized"`
	Bypassed   bool                   `json:"bypassed,omitempty" xml:"bypassed,omitempty" yaml:"bypassed,omitempty"`
	Error      error                  `json:"error,omitempty" xml:"error,omitempty" yaml:"error,omitempty"`
}

AuthorizationResponse holds the response associated with AuthorizationRequest.

type AuthorizationToken added in v1.0.7

type AuthorizationToken struct {
	Found   bool   `json:"found,omitempty" xml:"found,omitempty" yaml:"found,omitempty"`
	Payload string `json:"payload,omitempty" xml:"payload,omitempty" yaml:"payload,omitempty"`
	Name    string `json:"name,omitempty" xml:"name,omitempty" yaml:"name,omitempty"`
	Source  string `json:"source,omitempty" xml:"source,omitempty" yaml:"source,omitempty"`
}

AuthorizationToken holds the token found in an authorization request.

type Flags

type Flags struct {
	Enabled       bool `json:"enabled,omitempty" xml:"enabled,omitempty" yaml:"enabled,omitempty"`
	MfaRequired   bool `json:"mfa_required,omitempty" xml:"mfa_required,omitempty" yaml:"mfa_required,omitempty"`
	MfaConfigured bool `json:"mfa_configured,omitempty" xml:"mfa_configured,omitempty" yaml:"mfa_configured,omitempty"`
	MfaApp        bool `json:"mfa_app,omitempty" xml:"mfa_app,omitempty" yaml:"mfa_app,omitempty"`
	MfaUniversal  bool `json:"mfa_universal,omitempty" xml:"mfa_universal,omitempty" yaml:"mfa_universal,omitempty"`
}

Flags holds various flags.

type Key

type Key struct {
	ID       string `json:"id,omitempty" xml:"id,omitempty" yaml:"id,omitempty"`
	Prefix   string `json:"prefix,omitempty" xml:"prefix,omitempty" yaml:"prefix,omitempty"`
	Comment  string `json:"comment,omitempty" xml:"comment,omitempty" yaml:"comment,omitempty"`
	Usage    string `json:"usage,omitempty" xml:"usage,omitempty" yaml:"usage,omitempty"`
	Payload  string `json:"payload,omitempty" xml:"payload,omitempty" yaml:"payload,omitempty"`
	Disabled bool   `json:"disabled,omitempty" xml:"disabled,omitempty" yaml:"disabled,omitempty"`
}

Key holds crypto key attributes.

type MfaToken

type MfaToken struct {
	ID        string `json:"id,omitempty" xml:"id,omitempty" yaml:"id,omitempty"`
	Comment   string `json:"comment,omitempty" xml:"comment,omitempty" yaml:"comment,omitempty"`
	Type      string `json:"type,omitempty" xml:"type,omitempty" yaml:"type,omitempty"`
	Secret    string `json:"secret,omitempty" xml:"secret,omitempty" yaml:"secret,omitempty"`
	Algorithm string `json:"algorithm,omitempty" xml:"algorithm,omitempty" yaml:"algorithm,omitempty"`
	Period    int    `json:"period,omitempty" xml:"period,omitempty" yaml:"period,omitempty"`
	Digits    int    `json:"digits,omitempty" xml:"digits,omitempty" yaml:"digits,omitempty"`
	Passcode  string `json:"passcode,omitempty" xml:"passcode,omitempty" yaml:"passcode,omitempty"`
	Disabled  bool   `json:"disabled,omitempty" xml:"disabled,omitempty" yaml:"disabled,omitempty"`
}

MfaToken holds MFA token attributes.

type Query

type Query struct {
	ID   string `json:"id,omitempty" xml:"id,omitempty" yaml:"id,omitempty"`
	Name string `json:"name,omitempty" xml:"name,omitempty" yaml:"name,omitempty"`
}

Query hold request query attributes.

type RedirectResponse

type RedirectResponse struct {
	Enabled        bool   `json:"enabled,omitempty" xml:"enabled,omitempty" yaml:"enabled,omitempty"`
	AuthURL        string `json:"auth_url,omitempty" xml:"auth_url,omitempty" yaml:"auth_url,omitempty"`
	Separator      string `json:"separator,omitempty" xml:"separator,omitempty" yaml:"separator,omitempty"`
	QueryParameter string `json:"query_parameter,omitempty" xml:"query_parameter,omitempty" yaml:"query_parameter,omitempty"`
	QueryDisabled  bool   `json:"query_disabled,omitempty" xml:"query_disabled,omitempty" yaml:"query_disabled,omitempty"`
	URL            string `json:"url,omitempty" xml:"url,omitempty" yaml:"url,omitempty"`
	StatusCode     int    `json:"status_code,omitempty" xml:"status_code,omitempty" yaml:"status_code,omitempty"`
	LoginHint      string `json:"login_hint,omitempty" xml:"login_hint,omitempty" yaml:"login_hint,omitempty"`
}

RedirectResponse holds the redirect parameters associated with the response to AuthorizationRequest.

type Request

type Request struct {
	ID       string      `json:"id,omitempty" xml:"id,omitempty" yaml:"id,omitempty"`
	Upstream Upstream    `json:"upstream,omitempty" xml:"upstream,omitempty" yaml:"upstream,omitempty"`
	Sandbox  Sandbox     `json:"sandbox,omitempty" xml:"sandbox,omitempty" yaml:"sandbox,omitempty"`
	User     User        `json:"user,omitempty" xml:"user,omitempty" yaml:"user,omitempty"`
	Query    Query       `json:"query,omitempty" xml:"query,omitempty" yaml:"query,omitempty"`
	Key      Key         `json:"key,omitempty" xml:"key,omitempty" yaml:"key,omitempty"`
	MfaToken MfaToken    `json:"mfa_token,omitempty" xml:"mfa_token,omitempty" yaml:"mfa_token,omitempty"`
	WebAuthn WebAuthn    `json:"web_authn,omitempty" xml:"web_authn,omitempty" yaml:"web_authn,omitempty"`
	Flags    Flags       `json:"flags,omitempty" xml:"flags,omitempty" yaml:"flags,omitempty"`
	Response Response    `json:"response,omitempty" xml:"response,omitempty" yaml:"response,omitempty"`
	Logger   *zap.Logger `json:"-"`
}

Request hold the data associated with identity database

func NewRequest

func NewRequest() *Request

NewRequest returns an instance of Request.

type Response

type Response struct {
	Code              int         `json:"code,omitempty" xml:"code,omitempty" yaml:"code,omitempty"`
	RedirectURL       string      `json:"redirect_url,omitempty" xml:"redirect_url,omitempty" yaml:"redirect_url,omitempty"`
	Payload           interface{} `json:"-"`
	RedirectTokenName string      `json:"redirect_token_name,omitempty" xml:"redirect_token_name,omitempty" yaml:"redirect_token_name,omitempty"`
	Authenticated     bool        `json:"authenticated,omitempty" xml:"authenticated,omitempty" yaml:"authenticated,omitempty"`
	Authorized        bool        `json:"authorized,omitempty" xml:"authorized,omitempty" yaml:"authorized,omitempty"`
	// Workflow is the type of workflow the response should follow.
	Workflow string `json:"workflow,omitempty" xml:"workflow,omitempty" yaml:"workflow,omitempty"`
	Title    string `json:"title,omitempty" xml:"title,omitempty" yaml:"title,omitempty"`
	Message  string `json:"message,omitempty" xml:"message,omitempty" yaml:"message,omitempty"`
}

Response hold the response associated with identity database

type Sandbox

type Sandbox struct {
	ID     string `json:"id,omitempty" xml:"id,omitempty" yaml:"id,omitempty"`
	View   string `json:"view,omitempty" xml:"view,omitempty" yaml:"view,omitempty"`
	Action string `json:"action,omitempty" xml:"action,omitempty" yaml:"action,omitempty"`
}

Sandbox hold the data relevant to the user sandbox.

type Upstream

type Upstream struct {
	Request     *http.Request `json:"-"`
	Name        string        `json:"name,omitempty" xml:"name,omitempty" yaml:"name,omitempty"`
	SessionID   string        `json:"session_id,omitempty" xml:"session_id,omitempty" yaml:"session_id,omitempty"`
	BaseURL     string        `json:"base_url,omitempty" xml:"base_url,omitempty" yaml:"base_url,omitempty"`
	BasePath    string        `json:"base_path,omitempty" xml:"base_path,omitempty" yaml:"base_path,omitempty"`
	Method      string        `json:"method,omitempty" xml:"method,omitempty" yaml:"method,omitempty"`
	Realm       string        `json:"realm,omitempty" xml:"realm,omitempty" yaml:"realm,omitempty"`
	ContentType string        `json:"content_type,omitempty" xml:"content_type,omitempty" yaml:"content_type,omitempty"`
	CookieNames []string      `json:"cookie_names,omitempty" xml:"cookie_names,omitempty" yaml:"cookie_names,omitempty"`
}

Upstream hold the upstream request handler metadata.

type User

type User struct {
	Username    string   `json:"username,omitempty" xml:"username,omitempty" yaml:"username,omitempty"`
	Email       string   `json:"email,omitempty" xml:"email,omitempty" yaml:"email,omitempty"`
	Password    string   `json:"password,omitempty" xml:"password,omitempty" yaml:"password,omitempty"`
	OldPassword string   `json:"old_password,omitempty" xml:"old_password,omitempty" yaml:"old_password,omitempty"`
	FullName    string   `json:"full_name,omitempty" xml:"full_name,omitempty" yaml:"full_name,omitempty"`
	Roles       []string `json:"roles,omitempty" xml:"roles,omitempty" yaml:"roles,omitempty"`
	Disabled    bool     `json:"disabled,omitempty" xml:"disabled,omitempty" yaml:"disabled,omitempty"`
	Challenges  []string `json:"challenges,omitempty" xml:"challenges,omitempty" yaml:"challenges,omitempty"`
}

User hold user attributes.

type WebAuthn

type WebAuthn struct {
	Register  string `json:"register,omitempty" xml:"register,omitempty" yaml:"register,omitempty"`
	Challenge string `json:"challenge,omitempty" xml:"challenge,omitempty" yaml:"challenge,omitempty"`
	Request   string `json:"request,omitempty" xml:"request,omitempty" yaml:"request,omitempty"`
}

WebAuthn holds WebAuthn messages.

Jump to

Keyboard shortcuts

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