server

package
v1.15.1 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetProfileName

func GetProfileName(u *url.URL) string

GetProfileName returns the name of the profile as defined as /slot/XXXX

func SetLogger

func SetLogger(l *logrus.Logger)

func WithAuthorizationCheck

func WithAuthorizationCheck(authToken string, next http.HandlerFunc) http.HandlerFunc

WithAuthorizationCheck checks our authToken (if set) and returns 404 on error

Types

type DefaultHandler

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

func (DefaultHandler) Delete

func (p DefaultHandler) Delete(w http.ResponseWriter, r *http.Request)

func (DefaultHandler) Get

func (DefaultHandler) Put

func (DefaultHandler) ServeHTTP

func (p DefaultHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type EcsServer

type EcsServer struct {
	DefaultCreds *ecs.ECSClientRequest
	// contains filtered or unexported fields
}

func NewEcsServer

func NewEcsServer(ctx context.Context, authToken string, listen net.Listener) (*EcsServer, error)

NewEcsServer creates a new ECS Server

func (*EcsServer) AuthToken

func (e *EcsServer) AuthToken() string

AuthToken returns our authToken for authentication

func (*EcsServer) BaseURL

func (e *EcsServer) BaseURL() string

BaseURL returns our the base URL for all requests

func (*EcsServer) DeleteSlottedCreds

func (e *EcsServer) DeleteSlottedCreds(profile string) error

deleteCreds removes our slotted credentials from the cache

func (*EcsServer) GetSlottedCreds

func (e *EcsServer) GetSlottedCreds(profile string) (*ecs.ECSClientRequest, error)

getCreds fetches the named profile from the cache.

func (*EcsServer) ListSlottedCreds

func (e *EcsServer) ListSlottedCreds() []ecs.ListProfilesResponse

ListSlottedCreds returns the list of roles in our slots

func (*EcsServer) PutSlottedCreds

func (e *EcsServer) PutSlottedCreds(creds *ecs.ECSClientRequest) error

putCreds loads credentials into the cache

func (*EcsServer) Serve

func (e *EcsServer) Serve() error

Serve starts the sever and blocks

type ExpiredCredentials

type ExpiredCredentials struct{}

func (*ExpiredCredentials) Error

func (e *ExpiredCredentials) Error() string

type ProfileHandler

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

func (ProfileHandler) Get

func (ProfileHandler) ServeHTTP

func (p ProfileHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type SlottedHandler

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

func (*SlottedHandler) Delete

func (p *SlottedHandler) Delete(w http.ResponseWriter, r *http.Request)

func (*SlottedHandler) Get

func (*SlottedHandler) Put

func (SlottedHandler) ServeHTTP

func (p SlottedHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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