package auth import ( "context" "github.com/hashicorp/vault/api" ) func init() { register(githubMethod{}) } type githubMethod struct{} func (githubMethod) Name() string { return "github" } func (githubMethod) DisplayName() string { return "GitHub" } func (githubMethod) DefaultMount() string { return "github" } func (githubMethod) Fields() []Field { return []Field{ {Name: "token", Label: "GitHub personal access token", Kind: FieldSecret, Required: true, EnvFallback: []string{"VAULT_AUTH_GITHUB_TOKEN"}}, } } func (githubMethod) Login(ctx context.Context, c *api.Client, req Request) (*api.Secret, error) { mount := mountOf(req, "github") return loginWrite(ctx, c, mount, "login", map[string]interface{}{ "token": req.Creds.Get("token"), }) }