micro/auth/default.go
ben-toogood d621548120
Auth (#1147)
Implement the Auth interface, with JWT and service implementations.

* Update Auth Interface

* Define Auth Service Implementation

* Support Service Auth

* Add Auth Service Proto

* Remove erronious files

* Implement Auth Service Package

* Update Auth Interface

* Update Auth Interface. Add Validate, remove Add/Remove roles

* Make Revoke interface more explicit

* Refactor serializing and deserializing service accounts

* Fix srv name & update interface to be more explicit

* Require jwt public key for auth

* Rename Variables (Resource.ID => Resource.Name & ServiceAccount => Account)

* Implement JWT Auth Package

* Remove parent, add ID

* Update auth imports to v2. Add String() to auth interface
2020-02-03 08:16:02 +00:00

35 lines
575 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
}
// 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
}