workflow

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	BaseURL         *url.URL
	HttpClient      *http.Client
	PolicyEncrypter string // TODO: key, signingmethod etc
	Debug           int
}

func NewClient

func NewClient(baseUrl string) (*Client, error)

func (*Client) Create

func (c *Client) Create(ctx context.Context, req *CreateRequest) (*CreateResponse, error)

func (*Client) GetAssertions

func (c *Client) GetAssertions(ctx context.Context, req *GetAssertionsRequest) (*GetAssertionsResponse, error)

func (*Client) GetDetails

func (c *Client) GetDetails(ctx context.Context, req *GetDetailsRequest) (*GetDetailsResponse, error)

type CreateRequest

type CreateRequest struct {
	IdpNonce  string    `json:"idp_nonce"`
	Requester Requester `json:"requester"`
	Source    Source    `json:"source"`
	Target    Target    `json:"target"`
	// To be encrypted with workflow public key
	// TODO: change type here, separation of concerns...
	Policy Policy `json:"policy"`
}

type CreateResponse

type CreateResponse struct {
	WorkflowId    string `json:"workflow_id"`
	WorkflowUrl   string `json:"workflow_url"`
	WorkflowNonce string `json:"workflow_nonce"`
}

type GetAssertionsRequest

type GetAssertionsRequest struct {
	WorkflowId    string `json:"workflow_id"`
	WorkflowNonce string `json:"workflow_nonce"`
}

type GetAssertionsResponse

type GetAssertionsResponse struct {
	// Bag of SAML assertions. Could be wrapped(?)
	//Workflow Workflow `json:"workflow"` //???
	Status     string   `json:"status"`     //???
	Assertions []string `json:"assertions"` // Resulting IDP assertions
}

type GetDetailsRequest

type GetDetailsRequest struct {
}

type GetDetailsResponse

type GetDetailsResponse struct {
}

type Policy

type Policy struct {
	Name                string         `json:"name"`
	IdpName             string         `json:"idp_name"`
	RequesterCanApprove bool           `json:"requester_can_approve"`
	IdentifyRoles       map[string]int `json:"identify_roles"`
	ApproverRoles       map[string]int `json:"approver_roles"`
}

type Requester

type Requester struct {
	Name     string `json:"name"`
	Username string `json:"username"`
	Email    string `json:"email"`
}

type Source

type Source struct {
	// Source Key? For gitlab?
	Description string `json:"description"`
	DetailsURI  string `json:"details_uri"`
}

type Target

type Target struct {
	EnvironmentName         string `json:"environment_name"`
	EnvironmentDiscoveryURI string `json:"environment_discovery_uri"`
}

Jump to

Keyboard shortcuts

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