github.com/rajatvaryani/mattermost-server@v5.11.1+incompatible/model/saml.go (about)

     1  // Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
     2  // See License.txt for license information.
     3  
     4  package model
     5  
     6  import (
     7  	"encoding/json"
     8  	"io"
     9  )
    10  
    11  const (
    12  	USER_AUTH_SERVICE_SAML      = "saml"
    13  	USER_AUTH_SERVICE_SAML_TEXT = "SAML"
    14  )
    15  
    16  type SamlAuthRequest struct {
    17  	Base64AuthRequest string
    18  	URL               string
    19  	RelayState        string
    20  }
    21  
    22  type SamlCertificateStatus struct {
    23  	IdpCertificateFile    bool `json:"idp_certificate_file"`
    24  	PrivateKeyFile        bool `json:"private_key_file"`
    25  	PublicCertificateFile bool `json:"public_certificate_file"`
    26  }
    27  
    28  func (s *SamlCertificateStatus) ToJson() string {
    29  	b, _ := json.Marshal(s)
    30  	return string(b)
    31  }
    32  
    33  func SamlCertificateStatusFromJson(data io.Reader) *SamlCertificateStatus {
    34  	var status *SamlCertificateStatus
    35  	json.NewDecoder(data).Decode(&status)
    36  	return status
    37  }