mirror of
https://github.com/go-micro/go-micro.git
synced 2024-12-12 08:23:58 +02:00
4401c12e6c
* Auth Wrapper * Tweak cmd flag * auth_excludes => auth_exclude * Make Auth.Excludes variadic * Use metadata.Get (passes through http and http2 it will go through various case formats) * fix auth wrapper auth.Auth interface initialisation Co-authored-by: Asim Aslam <asim@aslam.me>
40 lines
654 B
Go
40 lines
654 B
Go
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
|
|
}
|
|
|
|
// Options set in init
|
|
func (a *noop) Options() Options {
|
|
return a.options
|
|
}
|
|
|
|
// 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
|
|
}
|