2020-02-03 11:16:02 +03:00
|
|
|
package auth
|
|
|
|
|
|
|
|
var (
|
|
|
|
DefaultAuth Auth = new(noop)
|
|
|
|
)
|
|
|
|
|
|
|
|
type noop struct {
|
|
|
|
options Options
|
|
|
|
}
|
|
|
|
|
|
|
|
// String name of implementation
|
|
|
|
func (a *noop) String() string {
|
|
|
|
return "noop"
|
|
|
|
}
|
|
|
|
|
|
|
|
// Init the svc
|
|
|
|
func (a *noop) Init(...Option) error {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2020-02-10 11:26:28 +03:00
|
|
|
// Options set in init
|
|
|
|
func (a *noop) Options() Options {
|
|
|
|
return a.options
|
|
|
|
}
|
|
|
|
|
2020-02-03 11:16:02 +03:00
|
|
|
// Generate a new auth Account
|
|
|
|
func (a *noop) Generate(id string, ops ...GenerateOption) (*Account, error) {
|
|
|
|
return nil, nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// Revoke an authorization Account
|
|
|
|
func (a *noop) Revoke(token string) error {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
// Validate a account token
|
|
|
|
func (a *noop) Validate(token string) (*Account, error) {
|
|
|
|
return nil, nil
|
|
|
|
}
|