59 lines
985 B
Go
59 lines
985 B
Go
package auth
|
|
|
|
type GrantType string
|
|
|
|
const (
|
|
GrantAuthorizationCode = GrantType("authorization_code") // 授权码模式
|
|
GrantClientCredentials = GrantType("client_credentials") // 客户端凭证模式
|
|
GrantRefreshToken = GrantType("refresh_token") // 刷新令牌模式
|
|
GrantPassword = GrantType("password") // 密码模式(私有扩展)
|
|
)
|
|
|
|
type PasswordGrantType string
|
|
|
|
const (
|
|
GrantPasswordSecret = PasswordGrantType("password") // 密码模式
|
|
GrantPasswordPhone = PasswordGrantType("phone_code") // 手机号模式
|
|
GrantPasswordEmail = PasswordGrantType("email_code") // 邮箱模式
|
|
)
|
|
|
|
func Token(grant GrantType) error {
|
|
return nil
|
|
}
|
|
|
|
func authAuthorizationCode() {
|
|
|
|
}
|
|
|
|
func authClientCredential() {
|
|
|
|
}
|
|
|
|
func authRefreshToken() {
|
|
|
|
}
|
|
|
|
func authPassword() {
|
|
|
|
}
|
|
|
|
func authPasswordSecret() {
|
|
|
|
}
|
|
|
|
func authPasswordPhone() {
|
|
|
|
}
|
|
|
|
func authPasswordEmail() {
|
|
|
|
}
|
|
|
|
func Revoke() error {
|
|
return nil
|
|
}
|
|
|
|
func Introspect() error {
|
|
return nil
|
|
}
|