mirror of
https://github.com/h44z/wg-portal.git
synced 2025-09-13 14:31:15 +00:00
cleanup
This commit is contained in:
@@ -4,10 +4,10 @@ import (
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
// AuthContext contains all information that the AuthProvider needs to perform the authentication.
|
||||
type AuthContext struct {
|
||||
Provider AuthProvider
|
||||
Username string // email or username
|
||||
Password string // optional for OIDC
|
||||
Password string
|
||||
Callback string // callback for OIDC
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@ const (
|
||||
AuthProviderTypeOauth AuthProviderType = "oauth"
|
||||
)
|
||||
|
||||
// AuthProvider is a interface that can be implemented by different authentication providers like LDAP, OAUTH, ...
|
||||
type AuthProvider interface {
|
||||
GetName() string
|
||||
GetType() AuthProviderType
|
||||
|
@@ -13,7 +13,7 @@ import (
|
||||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
// Provider provide login with password method
|
||||
// Provider implements a password login method for an LDAP backend.
|
||||
type Provider struct {
|
||||
config *ldapconfig.Config
|
||||
}
|
||||
|
@@ -14,7 +14,7 @@ import (
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
// Provider provide login with password method
|
||||
// Provider implements a password login method for a database backend.
|
||||
type Provider struct {
|
||||
db *gorm.DB
|
||||
}
|
||||
|
@@ -1,5 +1,6 @@
|
||||
package authentication
|
||||
|
||||
// User represents the data that can be retrieved from authentication backends.
|
||||
type User struct {
|
||||
Email string
|
||||
IsAdmin bool
|
||||
|
Reference in New Issue
Block a user