support Nextcloud OAuth 2.0 authentication
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
package models
|
||||
|
||||
// OAuth2LoginRequest represents all parameters of OAuth 2.0 login request
|
||||
type OAuth2LoginRequest struct {
|
||||
Platform string `form:"platform" binding:"required"`
|
||||
ClientSessionId string `form:"client_session_id" binding:"required"`
|
||||
}
|
||||
|
||||
// OAuth2CallbackRequest represents all parameters of OAuth 2.0 callback request
|
||||
type OAuth2CallbackRequest struct {
|
||||
State string `form:"state"`
|
||||
Code string `form:"code"`
|
||||
}
|
||||
|
||||
// OAuth2CallbackLoginRequest represents all parameters of OAuth 2.0 callback login request
|
||||
type OAuth2CallbackLoginRequest struct {
|
||||
Provider string `json:"provider" binding:"required,notBlank"`
|
||||
Password string `json:"password" binding:"omitempty,min=6,max=128"`
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
package models
|
||||
|
||||
import "github.com/mayswind/ezbookkeeping/pkg/core"
|
||||
|
||||
// UserExternalAuth represents user external auth data stored in database
|
||||
type UserExternalAuth struct {
|
||||
Uid int64 `xorm:"PK"`
|
||||
ExternalAuthType core.UserExternalAuthType `xorm:"VARCHAR(32) PK UNIQUE(uqe_userexternalauth_authtype_username) UNIQUE(uqe_userexternalauth_authtype_email)"`
|
||||
ExternalUsername string `xorm:"VARCHAR(32) UNIQUE(uqe_userexternalauth_authtype_username) NOT NULL"`
|
||||
ExternalEmail string `xorm:"VARCHAR(100) UNIQUE(uqe_userexternalauth_authtype_email) NOT NULL"`
|
||||
CreatedUnixTime int64
|
||||
}
|
||||
|
||||
// UserExternalAuthRevokeRequest represents all parameters of user external auth revoke request
|
||||
type UserExternalAuthRevokeRequest struct {
|
||||
ExternalAuthType core.UserExternalAuthType `json:"externalAuthType" binding:"required,notBlank"`
|
||||
}
|
||||
Reference in New Issue
Block a user