update with resource

This commit is contained in:
Asim Aslam 2019-12-17 21:27:05 +00:00
parent 7013e7467f
commit 515014fbeb

View File

@ -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