Implement SAML endpoints for APIv4 (#5671)
* Implement SAML endpoints for APIv4 * Fix unit test * Only disable encryption when removing puplic/private certs
Этот коммит содержится в:
коммит произвёл
George Goldberg
родитель
fe38d6d5bb
Коммит
3559fb7959
24
model/saml_test.go
Обычный файл
24
model/saml_test.go
Обычный файл
@@ -0,0 +1,24 @@
|
||||
// Copyright (c) 2017 Mattermost, Inc. All Rights Reserved.
|
||||
// See License.txt for license information.
|
||||
|
||||
package model
|
||||
|
||||
import (
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestSamlCertificateStatusJson(t *testing.T) {
|
||||
status := &SamlCertificateStatus{IdpCertificateFile: true, PrivateKeyFile: true, PublicCertificateFile: true}
|
||||
json := status.ToJson()
|
||||
rstatus := SamlCertificateStatusFromJson(strings.NewReader(json))
|
||||
|
||||
if status.IdpCertificateFile != rstatus.IdpCertificateFile {
|
||||
t.Fatal("IdpCertificateFile do not match")
|
||||
}
|
||||
|
||||
rstatus = SamlCertificateStatusFromJson(strings.NewReader("junk"))
|
||||
if rstatus != nil {
|
||||
t.Fatal("should be nil")
|
||||
}
|
||||
}
|
||||
Ссылка в новой задаче
Block a user