Auth Generate, make secret optional

This commit is contained in:
Ben Toogood
2020-04-01 17:20:02 +01:00
parent d577c32563
commit df8c0bb5e1
6 changed files with 79 additions and 59 deletions

View File

@@ -82,10 +82,19 @@ type GenerateOptions struct {
Provider string
// Type of the account, e.g. user
Type string
// Secret used to authenticate the account
Secret string
}
type GenerateOption func(o *GenerateOptions)
// WithSecret for the generated account
func WithSecret(s string) GenerateOption {
return func(o *GenerateOptions) {
o.Secret = s
}
}
// WithType for the generated account
func WithType(t string) GenerateOption {
return func(o *GenerateOptions) {