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
|
// Auth providers authentication and authorization
|
||||||
type Auth interface {
|
type Auth interface {
|
||||||
// Generate a new authorization token
|
// Generate a new auth token
|
||||||
Generate(u string) (*Token, error)
|
Generate(string) (*Token, error)
|
||||||
// Revoke an authorization token
|
// Revoke an authorization token
|
||||||
Revoke(t *Token) error
|
Revoke(*Token) error
|
||||||
// Verify a token
|
// Grant access to a resource
|
||||||
Verify(t *Token) error
|
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
|
// Token providers by an auth provider
|
||||||
|
Loading…
Reference in New Issue
Block a user