mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-10 18:05:48 +02:00
fix(casdoor): use certificate path instead to address env issue #584
This commit is contained in:
parent
4d1adac8c4
commit
20e55e715d
9 changed files with 62 additions and 52 deletions
|
@ -1,21 +1,21 @@
|
|||
package settings
|
||||
|
||||
type Casdoor struct {
|
||||
Endpoint string `json:"endpoint" protected:"true"`
|
||||
ClientId string `json:"client_id" protected:"true"`
|
||||
ClientSecret string `json:"client_secret" protected:"true"`
|
||||
Certificate string `json:"certificate" protected:"true"`
|
||||
Organization string `json:"organization" protected:"true"`
|
||||
Application string `json:"application" protected:"true"`
|
||||
RedirectUri string `json:"redirect_uri" protected:"true"`
|
||||
Endpoint string `json:"endpoint" protected:"true"`
|
||||
ClientId string `json:"client_id" protected:"true"`
|
||||
ClientSecret string `json:"client_secret" protected:"true"`
|
||||
CertificatePath string `json:"certificate_path" protected:"true"`
|
||||
Organization string `json:"organization" protected:"true"`
|
||||
Application string `json:"application" protected:"true"`
|
||||
RedirectUri string `json:"redirect_uri" protected:"true"`
|
||||
}
|
||||
|
||||
var CasdoorSettings = Casdoor{
|
||||
Endpoint: "",
|
||||
ClientId: "",
|
||||
ClientSecret: "",
|
||||
Certificate: "",
|
||||
Organization: "",
|
||||
Application: "",
|
||||
RedirectUri: "",
|
||||
Endpoint: "",
|
||||
ClientId: "",
|
||||
ClientSecret: "",
|
||||
CertificatePath: "",
|
||||
Organization: "",
|
||||
Application: "",
|
||||
RedirectUri: "",
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ func TestSetup(t *testing.T) {
|
|||
_ = os.Setenv("NGINX_UI_CASDOOR_ENDPOINT", "https://casdoor.example.com")
|
||||
_ = os.Setenv("NGINX_UI_CASDOOR_CLIENT_ID", "clientId")
|
||||
_ = os.Setenv("NGINX_UI_CASDOOR_CLIENT_SECRET", "clientSecret")
|
||||
_ = os.Setenv("NGINX_UI_CASDOOR_CERTIFICATE", "cert.pem")
|
||||
_ = os.Setenv("NGINX_UI_CASDOOR_CERTIFICATE_PATH", "cert.pem")
|
||||
_ = os.Setenv("NGINX_UI_CASDOOR_ORGANIZATION", "org1")
|
||||
_ = os.Setenv("NGINX_UI_CASDOOR_APPLICATION", "app1")
|
||||
_ = os.Setenv("NGINX_UI_CASDOOR_REDIRECT_URI", "https://redirect.example.com")
|
||||
|
@ -93,7 +93,7 @@ func TestSetup(t *testing.T) {
|
|||
assert.Equal(t, "https://casdoor.example.com", CasdoorSettings.Endpoint)
|
||||
assert.Equal(t, "clientId", CasdoorSettings.ClientId)
|
||||
assert.Equal(t, "clientSecret", CasdoorSettings.ClientSecret)
|
||||
assert.Equal(t, "cert.pem", CasdoorSettings.Certificate)
|
||||
assert.Equal(t, "cert.pem", CasdoorSettings.CertificatePath)
|
||||
assert.Equal(t, "org1", CasdoorSettings.Organization)
|
||||
assert.Equal(t, "app1", CasdoorSettings.Application)
|
||||
assert.Equal(t, "https://redirect.example.com", CasdoorSettings.RedirectUri)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue