Skip to content

Commit

Permalink
Merge pull request #173 from bedinger/admin-saml-group-uri-encode
Browse files Browse the repository at this point in the history
Refs #172
  • Loading branch information
rrossetti-splunk authored Aug 16, 2023
2 parents 96ca38a + 2809a79 commit 7a9b8da
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions client/admin_saml_groups.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package client
import (
"github.com/splunk/terraform-provider-splunk/client/models"
"net/http"
"net/url"

"github.com/google/go-querystring/query"
)
Expand All @@ -23,7 +24,7 @@ func (client *Client) CreateAdminSAMLGroups(name string, adminSAMLGroupsObject *
}

func (client *Client) ReadAdminSAMLGroups(name string) (*http.Response, error) {
endpoint := client.BuildSplunkURL(nil, "services", "admin", "SAML-groups", name)
endpoint := client.BuildSplunkURL(nil, "services", "admin", "SAML-groups", url.PathEscape(name))
resp, err := client.Get(endpoint)
if err != nil {
return nil, err
Expand All @@ -39,7 +40,7 @@ func (client *Client) UpdateAdminSAMLGroups(name string, adminSAMLGroupsObject *
}
// Not required for updates
values.Del("name")
endpoint := client.BuildSplunkURL(nil, "services", "admin", "SAML-groups", name)
endpoint := client.BuildSplunkURL(nil, "services", "admin", "SAML-groups", url.PathEscape(name))
resp, err := client.Post(endpoint, values)
if err != nil {
return err
Expand All @@ -49,7 +50,7 @@ func (client *Client) UpdateAdminSAMLGroups(name string, adminSAMLGroupsObject *
}

func (client *Client) DeleteAdminSAMLGroups(name string) (*http.Response, error) {
endpoint := client.BuildSplunkURL(nil, "services", "admin", "SAML-groups", name)
endpoint := client.BuildSplunkURL(nil, "services", "admin", "SAML-groups", url.PathEscape(name))
resp, err := client.Delete(endpoint)
if err != nil {
return nil, err
Expand Down

0 comments on commit 7a9b8da

Please sign in to comment.