Add api for identity provider login (#5534)

* add api for ldap login

* update ldap login to identity provider login for more flexible login type

Signed-off-by: wenhaozhou <wenhaozhou@yunify.com>

* update PasswordAuthenticate

Signed-off-by: wenhaozhou <wenhaozhou@yunify.com>

* add test case

Signed-off-by: wenhaozhou <wenhaozhou@yunify.com>

* update api path

Signed-off-by: wenhaozhou <wenhaozhou@yunify.com>

* make goimports and add annotations

Signed-off-by: wenhaozhou <wenhaozhou@yunify.com>

* update func names & add annotations

Signed-off-by: wenhaozhou <wenhaozhou@yunify.com>

---------

Signed-off-by: wenhaozhou <wenhaozhou@yunify.com>
This commit is contained in:
Wenhao Zhou
2023-02-27 18:35:35 +08:00
committed by GitHub
parent 9dad732860
commit dc28a0917a
7 changed files with 153 additions and 83 deletions

View File

@@ -336,7 +336,7 @@ type LoginRecord struct {
}
type LoginRecordSpec struct {
// Which authentication method used, BasicAuth/OAuth
// Which authentication method used, Password/OAuth/Token
Type LoginType `json:"type"`
// Provider of authentication, Ldap/Github etc.
Provider string `json:"provider"`
@@ -353,9 +353,9 @@ type LoginRecordSpec struct {
type LoginType string
const (
BasicAuth LoginType = "Basic"
OAuth LoginType = "OAuth"
Token LoginType = "Token"
Password LoginType = "Password"
OAuth LoginType = "OAuth"
Token LoginType = "Token"
)
// +kubebuilder:object:root=true