authinfo

package
v0.0.15 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2021 License: Apache-2.0 Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContextWithAuthInfo added in v0.0.8

func ContextWithAuthInfo(ctx context.Context,
	authInfo AuthInfo) context.Context

ContextWithAuthInfo returns a copy of a context with authentication information added.

func ListToMap

func ListToMap(list []string) map[string]struct{}

ListToMap is a convenience function to convert a slice of strings to a map of strings.

func MapToList

func MapToList(list map[string]struct{}) []string

MapToList is a convenience function to convert a map of strings to a sorted slice of strings.

Types

type AuthInfo

type AuthInfo struct {
	AwsRole          *AwsRole
	Expires          time.Time
	Groups           []string
	PermittedMethods []string
	Username         string
	// contains filtered or unexported fields
}

AuthInfo contains authentication information.

func GetAuthInfoFromContext added in v0.0.8

func GetAuthInfoFromContext(ctx context.Context) *AuthInfo

GetAuthInfoFromContext will return authentication information from a context, if available.

func (*AuthInfo) CheckGroup

func (ai *AuthInfo) CheckGroup(group string) bool

CheckGroup will return true if the specified group is present in the list. It uses an O(1) lookup.

func (*AuthInfo) Write added in v0.0.9

func (ai *AuthInfo) Write(writer io.Writer,
	prefix, space, postfix string) error

Write will write the authentication information in a human-readable format. Each line will be preceeded by a prefix and succeeded with a postfix. The specified space string will be used for further indentation.

type AwsRole

type AwsRole struct {
	AccountId string
	ARN       string
	Name      string
}

Directories

Path Synopsis
Package x509util provides utility functions to process X.509 certificates.
Package x509util provides utility functions to process X.509 certificates.

Jump to

Keyboard shortcuts

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