rotakey

package module
v1.0.151 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2023 License: MIT Imports: 14 Imported by: 0

README

github.com/jylitalo/rotakey

Overview

Package rotakey helps you rotate AWS keys

Go Reference Go Report Card

Currently supports awscli default configuration.

to build

go build -o rotakey main/main.go

Imports: 14

Index

Examples

This section is empty.

Constants

This section is empty.

Variables

This section is empty.

Types

type AwsConfig
type AwsConfig struct {}
func (cf *AwsConfig) AccessKeyID
func (cf *AwsConfig) AccessKeyID(ctx context.Context) (string, error)
func (cf *AwsConfig) LoadDefaultConfig
func (cf *AwsConfig) LoadDefaultConfig(ctx context.Context) error
func (cf *AwsConfig) NewIam
func (cf *AwsConfig) NewIam() awstypes.AwsIam
type DotAws
type DotAws struct {}
func (da DotAws) GetProfile
func (da DotAws) GetProfile(accessKeyId string) (*ini.Section, error)
func (da DotAws) Load
func (da DotAws) Load() error
func (da DotAws) Save
func (da DotAws) Save(profile *ini.Section, accessKey iamtypes.AccessKey) error
type Rotate
type Rotate struct {}
func (client Rotate) Execute
func (client Rotate) Execute(awsCfg types.AwsConfig, fileCfg types.DotAws) error

Execute rotates user's AWS credentials in ~/.aws/credentials Possible error messages are:

  • %s does not exist
  • failed to check %s
  • failed to create access key due to %v
  • failed to delete access key due to %v
  • failed to save %s due to %v
  • no profile with %s access key id
  • unable to find AWS profile due to AWS_SESSION_TOKEN
  • InvalidClientTokenId at CreateAccessKey: The security token (%s) included in the request is invalid
  • InvalidClientTokenId at DeleteAccessKey: The security token (%s) included in the request is invalid
  • LimitExceeded: Cannot exceed quota for AccessKeysPerUser: %d

--

Generated by github.com/jylitalo/go2md v0.4.1

Documentation

Overview

Package rotakey helps you rotate AWS keys

[![Go Reference](https://pkg.go.dev/badge/github.com/jylitalo/rotakey.svg)](https://pkg.go.dev/github.com/jylitalo/rotakey) [![Go Report Card](https://goreportcard.com/badge/github.com/jylitalo/rotakey)](https://goreportcard.com/report/github.com/jylitalo/rotakey)

Currently supports awscli default configuration.

to build

`go build -o rotakey main/main.go`

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AwsConfig added in v1.0.95

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

func (*AwsConfig) AccessKeyID added in v1.0.121

func (cf *AwsConfig) AccessKeyID(ctx context.Context) (string, error)

func (*AwsConfig) LoadDefaultConfig added in v1.0.121

func (cf *AwsConfig) LoadDefaultConfig(ctx context.Context) error

func (*AwsConfig) NewIam added in v1.0.121

func (cf *AwsConfig) NewIam() awstypes.AwsIam

type DotAws added in v1.0.95

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

func (DotAws) GetProfile added in v1.0.121

func (da DotAws) GetProfile(accessKeyId string) (*ini.Section, error)

func (DotAws) Load added in v1.0.121

func (da DotAws) Load() error

func (DotAws) Save added in v1.0.121

func (da DotAws) Save(profile *ini.Section, accessKey iamtypes.AccessKey) error

type Rotate added in v1.0.121

type Rotate struct{}

func (Rotate) Execute added in v1.0.121

func (client Rotate) Execute(awsCfg types.AwsConfig, fileCfg types.DotAws) error

Execute rotates user's AWS credentials in ~/.aws/credentials Possible error messages are: - %s does not exist - failed to check %s - failed to create access key due to %v - failed to delete access key due to %v - failed to save %s due to %v - no profile with %s access key id - unable to find AWS profile due to AWS_SESSION_TOKEN - InvalidClientTokenId at CreateAccessKey: The security token (%s) included in the request is invalid - InvalidClientTokenId at DeleteAccessKey: The security token (%s) included in the request is invalid - LimitExceeded: Cannot exceed quota for AccessKeysPerUser: %d

Directories

Path Synopsis
Package cmd provides spf13/cobra interface to package
Package cmd provides spf13/cobra interface to package
Package internal provides simple functions for internal usage.
Package internal provides simple functions for internal usage.
Package main provides main function for standalone usage.
Package main provides main function for standalone usage.
Package mock provides mocks for tests
Package mock provides mocks for tests
Package types has all type definitions for functions and their mocks
Package types has all type definitions for functions and their mocks

Jump to

Keyboard shortcuts

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