lister

package
v2.17.0 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package lister provides the endpoint to retrieve multiple credentials

Index

Constants

View Source
const (
	// Method is the HTTP method to act on.
	Method = "GET"
	// Name is the name of our endpoint.
	Name = "lister"
	// Path is the URI path our endpoint listens to.
	Path = "/v4/organizations/{organization}/credentials/"
)

Variables

This section is empty.

Functions

func IsInvalidConfig

func IsInvalidConfig(err error) bool

IsInvalidConfig asserts invalidConfigError.

Types

type Config

type Config struct {
	Logger     micrologger.Logger
	Middleware *middleware.Middleware // nolint: structcheck, unused
	Service    *lister.Service
}

Config defines which configuration our endpoint expects.

type Endpoint

type Endpoint struct {
	// contains filtered or unexported fields
}

Endpoint is the actual endpoint data structure.

func New

func New(config Config) (*Endpoint, error)

New creates a new endpoint with configuration.

func (*Endpoint) Decoder

func (e *Endpoint) Decoder() kithttp.DecodeRequestFunc

Decoder gets all useful information from a request to the endpoint.

func (*Endpoint) Encoder

func (e *Endpoint) Encoder() kithttp.EncodeResponseFunc

Encoder creates a response in the specified format.

func (*Endpoint) Endpoint

func (e *Endpoint) Endpoint() kitendpoint.Endpoint

Endpoint is where requests are handled and responses are returned.

func (*Endpoint) Method

func (e *Endpoint) Method() string

Method returns the HTTP method supported by this endpoint.

func (*Endpoint) Middlewares

func (e *Endpoint) Middlewares() []kitendpoint.Middleware

Middlewares returns the middlewares used by this endpoint.

func (*Endpoint) Name

func (e *Endpoint) Name() string

Name returns this endpoint's name.

func (*Endpoint) Path

func (e *Endpoint) Path() string

Path returns this endpoint's URI path.

type Request

type Request struct {
	Organization string
}

Request is the request the lister service expects.

type Response

type Response struct {
	ID       string         `json:"id"`
	Provider string         `json:"provider"`
	AWS      *ResponseAWS   `json:"aws,omitempty"`
	Azure    *ResponseAzure `json:"azure,omitempty"`
}

Response is the response format our endpoint will return.

type ResponseAWS

type ResponseAWS struct {
	Roles *ResponseAWSRoles `json:"roles"`
}

ResponseAWS is a type used by above Response.

type ResponseAWSRoles

type ResponseAWSRoles struct {
	Admin       string `json:"admin"`
	AWSOperator string `json:"awsoperator"`
}

ResponseAWSRoles is a type used by above AWSData struct.

type ResponseAzure

type ResponseAzure struct {
	Credential *ResponseAzureCredential `json:"credential"`
}

ResponseAzure is a type used by above Response struct.

type ResponseAzureCredential

type ResponseAzureCredential struct {
	ClientID       string `json:"client_id"`
	SubscriptionID string `json:"subscription_id"`
	TenantID       string `json:"tenant_id"`
}

ResponseAzureCredential is a type used by above Response struct.

Jump to

Keyboard shortcuts

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