update with resource
This commit is contained in:
parent
7013e7467f
commit
515014fbeb
18
auth/auth.go
18
auth/auth.go
@ -7,12 +7,20 @@ import (
|
||||
|
||||
// Auth providers authentication and authorization
|
||||
type Auth interface {
|
||||
// Generate a new authorization token
|
||||
Generate(u string) (*Token, error)
|
||||
// Generate a new auth token
|
||||
Generate(string) (*Token, error)
|
||||
// Revoke an authorization token
|
||||
Revoke(t *Token) error
|
||||
// Verify a token
|
||||
Verify(t *Token) error
|
||||
Revoke(*Token) error
|
||||
// Grant access to a resource
|
||||
Grant(*Token, *Resource) error
|
||||
// Verify a token can access a resource
|
||||
Verify(*Token, *Resource) error
|
||||
}
|
||||
|
||||
// Resource is some thing to provide access to
|
||||
type Resource struct {
|
||||
// Name of the resource
|
||||
Name string
|
||||
}
|
||||
|
||||
// Token providers by an auth provider
|
||||
|
Loading…
x
Reference in New Issue
Block a user