-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added AuthenticateFromHeader and AuthenticateFromCookie functio…
…ns to Authenticator interface and implementation * Added AuthenticateFromHeader and AuthenticateFromCookie functions to Authenticator interface and implementation * Upgraded dependencies
- Loading branch information
1 parent
f1af465
commit 46814f5
Showing
6 changed files
with
121 additions
and
15 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
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
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
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,13 +1,21 @@ | ||
package auth | ||
|
||
import ( | ||
gojwtinterception "github.com/ralvarezdev/go-jwt/token/interception" | ||
gojwttoken "github.com/ralvarezdev/go-jwt/token" | ||
"net/http" | ||
) | ||
|
||
// Authenticator interface | ||
type Authenticator interface { | ||
Authenticate( | ||
interception gojwtinterception.Interception, | ||
token gojwttoken.Token, | ||
rawToken string, | ||
) func(next http.Handler) http.Handler | ||
AuthenticateFromHeader( | ||
token gojwttoken.Token, | ||
) func(next http.Handler) http.Handler | ||
AuthenticateFromCookie( | ||
token gojwttoken.Token, | ||
cookieName string, | ||
) func(next http.Handler) http.Handler | ||
} |
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
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