-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from Stratoscale/authoizer
support authorizer api
- Loading branch information
Showing
2 changed files
with
17 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,17 @@ | ||
package auth | ||
|
||
import "context" | ||
import ( | ||
"context" | ||
"net/http" | ||
) | ||
|
||
// Auth functions | ||
type Auth interface { | ||
APIKey(token string) (interface{}, error) | ||
Basic(user, password string) (interface{}, error) | ||
OAuth2(token string, scopes []string) (interface{}, error) | ||
// Authorize gets a request and return error if it is not authorized | ||
Authorize(r *http.Request) error | ||
// AuthStore is a function that stores authentication in the context object | ||
Store(context.Context, interface{}) context.Context | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters