mirror of https://github.com/go-sonic/sonic.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
418 B
Go
19 lines
418 B
Go
package authentication
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/golang-jwt/jwt"
|
|
)
|
|
|
|
type ContentAuthentication interface {
|
|
Authenticate(ctx context.Context, token string, id int32, password string) (string, error)
|
|
IsAuthenticated(ctx context.Context, token string, id int32) (bool, error)
|
|
}
|
|
|
|
type customClaims struct {
|
|
CategoryIDs []int32 `json:"category_ids"`
|
|
PostIDs []int32 `json:"post_ids"`
|
|
jwt.StandardClaims
|
|
}
|