iamauthtest

package
v0.0.0-...-76a921d Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2023 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTestServer

func NewTestServer(t *testing.T, s *Server) *httptest.Server

NewTestServer returns a fake AWS API server for local tests: It supports the following paths:

/sts returns STS API responses
/iam returns IAM API responses

Types

type Fixture

type Fixture struct {
	AssumedRoleARN   string
	CanonicalRoleARN string
	RoleARN          string
	RoleARNWildcard  string
	RoleName         string
	RolePath         string
	RoleTags         map[string]string

	EntityID            string
	EntityIDWithSession string
	AccountID           string

	UserARN         string
	UserARNWildcard string
	UserName        string
	UserPath        string
	UserTags        map[string]string

	ServerForRole *Server
	ServerForUser *Server
}

func MakeFixture

func MakeFixture() Fixture

func (*Fixture) RoleTagKeys

func (f *Fixture) RoleTagKeys() []string

func (*Fixture) RoleTagValues

func (f *Fixture) RoleTagValues() []string

func (*Fixture) UserTagKeys

func (f *Fixture) UserTagKeys() []string

func (*Fixture) UserTagValues

func (f *Fixture) UserTagValues() []string

type Server

type Server struct {
	GetCallerIdentityResponse responses.GetCallerIdentityResponse
	GetRoleResponse           responses.GetRoleResponse
	GetUserResponse           responses.GetUserResponse
}

Server contains configuration for the fake AWS API server.

func (*Server) ServeHTTP

func (s *Server) 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