use hard-coded names for saml certificates (#10341)

This preserves the ability to use custom file names -- required for backwards compatibility -- but forces names upon all newly uploaded certificates, avoiding clashes with other configuration files and skipping the need for file safety checks.
Этот коммит содержится в:
Jesse Hallam
2019-02-26 12:17:49 -05:00
коммит произвёл GitHub
родитель 72448d12a9
Коммит e1ed46605a
3 изменённых файлов: 18 добавлений и 21 удалений

Просмотреть файл

@@ -2944,6 +2944,7 @@ func samlFileToMultipart(data []byte, filename string) ([]byte, *multipart.Write
}
// UploadSamlIdpCertificate will upload an IDP certificate for SAML and set the config to use it.
// The filename parameter is deprecated and ignored: the server will pick a hard-coded filename when writing to disk.
func (c *Client4) UploadSamlIdpCertificate(data []byte, filename string) (bool, *Response) {
body, writer, err := samlFileToMultipart(data, filename)
if err != nil {
@@ -2955,6 +2956,7 @@ func (c *Client4) UploadSamlIdpCertificate(data []byte, filename string) (bool,
}
// UploadSamlPublicCertificate will upload a public certificate for SAML and set the config to use it.
// The filename parameter is deprecated and ignored: the server will pick a hard-coded filename when writing to disk.
func (c *Client4) UploadSamlPublicCertificate(data []byte, filename string) (bool, *Response) {
body, writer, err := samlFileToMultipart(data, filename)
if err != nil {
@@ -2966,6 +2968,7 @@ func (c *Client4) UploadSamlPublicCertificate(data []byte, filename string) (boo
}
// UploadSamlPrivateCertificate will upload a private key for SAML and set the config to use it.
// The filename parameter is deprecated and ignored: the server will pick a hard-coded filename when writing to disk.
func (c *Client4) UploadSamlPrivateCertificate(data []byte, filename string) (bool, *Response) {
body, writer, err := samlFileToMultipart(data, filename)
if err != nil {