Browse Source

EDL-28-update-client

Co-authored-by: Lorenceau Pablo <pablo.lorenceau@elca.ch>
master
pablo-lo 6 years ago
committed by GitHub
parent
commit
16d34783cc
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      api/clients.go

6
api/clients.go

@ -4,6 +4,7 @@ import (
"errors"
"github.com/cloudtrust/keycloak-client"
"gopkg.in/h2non/gentleman.v2/plugins/body"
"gopkg.in/h2non/gentleman.v2/plugins/url"
)
@ -35,6 +36,11 @@ func (c *Client) GetClient(accessToken string, realmName, idClient string) (keyc
return resp, err
}
// UpdateClient updates the client. idClient is the id of client (not client-id).
func (c *Client) UpdateClient(accessToken string, realmName, idClient string, clientRep keycloak.ClientRepresentation) error {
return c.put(accessToken, url.Path(clientIDPath), url.Param("realm", realmName), url.Param("id", idClient), body.JSON(clientRep))
}
// GetClientMappers gets mappers of the client specified by id
func (c *Client) GetClientMappers(accessToke string, realmName, idClient string) ([]keycloak.ClientMapperRepresentation, error) {
var resp = []keycloak.ClientMapperRepresentation{}

Loading…
Cancel
Save