Skip to content

Add system WebAPI #89

@EvilLord666

Description

@EvilLord666
  • Create/Update/Delete new realms by sys
  • Each Realm should have it own Admin that could perform all operations over User && Clients, however system admin could fix everything
  • Admin API must be compatible with KeyCloak API. KeyCloak admin API is described here. API specification is shown here

ONE Thing that MUST be taken into account - ServerSettings.AdminUrlPrefix property, therefore base URL looks as follows: consider e35yhu89 is a prefix, baseUrl in this case - http://127.0.0.1/e35yhu89

List of methods that will be implemented in this issue:

  1. Realm API - {base url}/admin/realms
  • GET ~/admin/realms, returns array of RealmRepresentation
  • GET ~/admin/realms/{realm} return single RealmRepresentation
  • POST /admin/realms <- in docs it is said: "...Import a realm. Imports a realm from a full representation of that realm..."
  • DELETE /admin/realms/{realm} removes a realm
  1. Client API
  • GET /admin/realms/{realm}/clients get realm Clients as array of ClientRepresentation
  • GET /admin/realms/{realm}/clients/{client-uuid} get single Client as ClientRepresentation
  • POST /admin/realms/{realm}/clients with client representation in a body
  • PUT /admin/realms/{realm}/clients/{client-uuid} with ClientRepresentation in a body
  • DELETE /admin/realms/{realm}/clients/{client-uuid}
  1. User API
  • GET ~/admin/realms/{realm}/users returns **array ** of UserRepresentation
  • GET /admin/realms/{realm}/users/{user-id} return single UserRepresentation
  • POST /admin/realms/{realm}/users UserRepresentation passes through the body
  • DELETE /admin/realms/{realm}/users/{user-id}

API must be compatible with KeycloakAdmin API For testing compatibility it is possible to take nerzal/go-cloak package for testing Admin API through this package

RealmRepresentation, UserRepresentation and ClientRepresentation must be configurable as JSON Path which is used to create from data objects, config probably must be stored in data.Realm
Additionally there are RealmOwner and RealmAdmin that could be configured, therefore we should have additional methods (own, not-compatible with KeyCloak) for this (but probably there are Keycloak admin method that are similar to listed below):

  1. PUT /admin/realms/{realm}/owner to set a realm owner
  2. PUT /admin/realms/{realm}/admins to set a realm admins

Metadata

Metadata

Labels

Type

No type

Projects

Status

No status

Relationships

None yet

Development

No branches or pull requests

Issue actions