Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompareHashAndPassword ¶
Types ¶
type Claims ¶
type Claims struct { Username string `json:"username"` jwt.RegisteredClaims }
Create a struct that will be encoded to a JWT. We add jwt.RegisteredClaims as an embedded type, to provide fields like expiry time
type Service ¶
type Service interface { Register(ctx context.Context, loginName, pwd string) (string, error) Login(ctx context.Context, loginName, pwd string, auth bool) (bool, string, error) GetPubKey(ctx context.Context, loginName string, keyName string) ([]byte, error) ListPubKeys(ctx context.Context, loginName string) ([]query.Key, error) CreatePubKey(ctx context.Context, loginName, keyName string, pubKey []byte) error ValidateJWT(token string) (string, error) }
Click to show internal directories.
Click to hide internal directories.