-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6d20ce5
commit 892d66e
Showing
5 changed files
with
63 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
src/Keycloak.AuthServices.Sdk/Admin/IKeycloakGroupClient.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
namespace Keycloak.AuthServices.Sdk.Admin; | ||
|
||
using System.Collections; | ||
using System.Threading.Tasks; | ||
using Constants; | ||
using Models; | ||
using Refit; | ||
using Requests.Users; | ||
|
||
/// <summary> | ||
/// Group management | ||
/// </summary> | ||
[Headers("Accept: application/json")] | ||
public interface IKeycloakGroupClient | ||
{ | ||
|
||
/// <summary> | ||
/// Get a stream of groups on the realm. | ||
/// </summary> | ||
/// <param name="realm">Realm name (not ID).</param> | ||
/// <param name="parameters">Optional query parameters.</param> | ||
/// <returns>A stream of groups, filtered according to query parameters.</returns> | ||
[Get(KeycloakClientApiConstants.GetGroups)] | ||
Task<IEnumerable<Group>> GetGroups(string realm, [Query] GetUsersRequestParameters? parameters = default); | ||
|
||
/// <summary> | ||
/// Get representation of a group. | ||
/// </summary> | ||
/// <param name="realm">Realm name (not ID).</param> | ||
/// <param name="groupId">group ID.</param> | ||
/// <returns>The group representation.</returns> | ||
[Get(KeycloakClientApiConstants.GetGroups)] | ||
Task<Group> GetGroups(string realm, [AliasAs("id")] string groupId); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#pragma warning disable CS1591, CS8618 | ||
namespace Keycloak.AuthServices.Sdk.Admin.Models; | ||
|
||
using System.Collections.Generic; | ||
|
||
/// <summary> | ||
/// Group representation. | ||
/// </summary> | ||
public class Group | ||
{ | ||
public string? Id { get; init; } | ||
public string? Name { get; init; } | ||
public string? Path { get; init; } | ||
public Dictionary<string, string>? ClientRoles { get; init; } | ||
public string[]? RealmRoles { get; init; } | ||
public Group[]? SubGroups { get; init; } | ||
public Dictionary<string, string[]>? Attributes { get; init; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters