2using System.Collections.Generic;
5using System.Threading.Tasks;
8using HotChocolate.Types;
9using HotChocolate.Types.Relay;
45 IEnumerable<OAuthConnection>? oAuthConnections,
46 IEnumerable<OidcConnection>? oidcConnections,
49 CancellationToken cancellationToken)
51 ArgumentNullException.ThrowIfNull(name);
52 ArgumentNullException.ThrowIfNull(password);
53 ArgumentNullException.ThrowIfNull(userAuthority);
56 authority => authority.Create(
69 OAuthConnections = oAuthConnections
70 ?.Select(oAuthConnection =>
new Api.Models.OAuthConnection
72 ExternalUserId = oAuthConnection.ExternalUserId,
73 Provider = oAuthConnection.Provider,
76 OidcConnections = oidcConnections
77 ?.Select(oidcConnection =>
new Api.Models.OidcConnection
79 ExternalUserId = oidcConnection.ExternalUserId,
80 SchemeKey = oidcConnection.SchemeKey,
105 IEnumerable<OAuthConnection>? oAuthConnections,
106 IEnumerable<OidcConnection>? oidcConnections,
109 CancellationToken cancellationToken)
111 ArgumentNullException.ThrowIfNull(name);
112 ArgumentNullException.ThrowIfNull(password);
113 ArgumentNullException.ThrowIfNull(userAuthority);
116 authority => authority.Create(
126 OAuthConnections = oAuthConnections
127 ?.Select(oAuthConnection =>
new Api.Models.OAuthConnection
129 ExternalUserId = oAuthConnection.ExternalUserId,
130 Provider = oAuthConnection.Provider,
133 OidcConnections = oidcConnections
134 ?.Select(oidcConnection =>
new Api.Models.OidcConnection
136 ExternalUserId = oidcConnection.ExternalUserId,
137 SchemeKey = oidcConnection.SchemeKey,
159 IEnumerable<OAuthConnection>? oAuthConnections,
160 IEnumerable<OidcConnection>? oidcConnections,
164 CancellationToken cancellationToken)
166 ArgumentNullException.ThrowIfNull(name);
167 ArgumentNullException.ThrowIfNull(oAuthConnections);
168 ArgumentNullException.ThrowIfNull(userAuthority);
171 authority => authority.Create(
175 Password = String.Empty,
184 OAuthConnections = oAuthConnections
185 .Select(oAuthConnection =>
new Api.Models.OAuthConnection
187 ExternalUserId = oAuthConnection.ExternalUserId,
188 Provider = oAuthConnection.Provider,
191 OidcConnections = oidcConnections
192 ?.Select(oidcConnection =>
new Api.Models.OidcConnection
194 ExternalUserId = oidcConnection.ExternalUserId,
195 SchemeKey = oidcConnection.SchemeKey,
217 IEnumerable<OAuthConnection> oAuthConnections,
218 IEnumerable<OidcConnection> oidcConnections,
222 CancellationToken cancellationToken)
224 ArgumentNullException.ThrowIfNull(name);
225 ArgumentNullException.ThrowIfNull(oAuthConnections);
226 ArgumentNullException.ThrowIfNull(userAuthority);
229 authority => authority.Create(
233 Password = String.Empty,
239 OAuthConnections = oAuthConnections
240 .Select(oAuthConnection =>
new Api.Models.OAuthConnection
242 ExternalUserId = oAuthConnection.ExternalUserId,
243 Provider = oAuthConnection.Provider,
246 OidcConnections = oidcConnections
247 ?.Select(oidcConnection =>
new Api.Models.OidcConnection
249 ExternalUserId = oidcConnection.ExternalUserId,
250 SchemeKey = oidcConnection.SchemeKey,
271 string systemIdentifier,
273 IEnumerable<OAuthConnection>? oAuthConnections,
274 IEnumerable<OidcConnection>? oidcConnections,
277 CancellationToken cancellationToken)
279 ArgumentNullException.ThrowIfNull(systemIdentifier);
280 ArgumentNullException.ThrowIfNull(userAuthority);
283 authority => authority.Create(
286 SystemIdentifier = systemIdentifier,
295 OAuthConnections = oAuthConnections
296 ?.Select(oAuthConnection =>
new Api.Models.OAuthConnection
298 ExternalUserId = oAuthConnection.ExternalUserId,
299 Provider = oAuthConnection.Provider,
302 OidcConnections = oidcConnections
303 ?.Select(oidcConnection =>
new Api.Models.OidcConnection
305 ExternalUserId = oidcConnection.ExternalUserId,
306 SchemeKey = oidcConnection.SchemeKey,
327 string systemIdentifier,
330 IEnumerable<OAuthConnection>? oAuthConnections,
331 IEnumerable<OidcConnection>? oidcConnections,
333 CancellationToken cancellationToken)
335 ArgumentNullException.ThrowIfNull(systemIdentifier);
336 ArgumentNullException.ThrowIfNull(userAuthority);
339 authority => authority.Create(
342 SystemIdentifier = systemIdentifier,
348 OAuthConnections = oAuthConnections
349 ?.Select(oAuthConnection =>
new Api.Models.OAuthConnection
351 ExternalUserId = oAuthConnection.ExternalUserId,
352 Provider = oAuthConnection.Provider,
355 OidcConnections = oidcConnections
356 ?.Select(oidcConnection =>
new Api.Models.OidcConnection
358 ExternalUserId = oidcConnection.ExternalUserId,
359 SchemeKey = oidcConnection.SchemeKey,
380 CancellationToken cancellationToken)
382 ArgumentNullException.ThrowIfNull(newPassword);
383 ArgumentNullException.ThrowIfNull(userAuthority);
385 authority => authority.Update(
388 Id = authenticationContext.User.
Id,
389 Password = newPassword,
405 IEnumerable<OAuthConnection>? newOAuthConnections,
406 IEnumerable<OidcConnection>? newOidcConnections,
409 CancellationToken cancellationToken)
411 ArgumentNullException.ThrowIfNull(newOAuthConnections);
412 ArgumentNullException.ThrowIfNull(userAuthority);
414 authority => authority.Update(
417 Id = authenticationContext.User.
Id,
418 OAuthConnections = newOAuthConnections
419 .Select(oAuthConnection =>
new Api.Models.OAuthConnection
421 ExternalUserId = oAuthConnection.ExternalUserId,
422 Provider = oAuthConnection.Provider,
425 OidcConnections = newOidcConnections
426 ?.Select(oidcConnection =>
new Api.Models.OidcConnection
428 ExternalUserId = oidcConnection.ExternalUserId,
429 SchemeKey = oidcConnection.SchemeKey,
450 [ID(nameof(
User))]
long id,
451 string? casingOnlyNameChange,
454 IEnumerable<OAuthConnection>? newOAuthConnections,
455 IEnumerable<OidcConnection>? newOidcConnections,
457 CancellationToken cancellationToken)
459 ArgumentNullException.ThrowIfNull(userAuthority);
462 casingOnlyNameChange,
488 [ID(nameof(
User))]
long id,
489 string? casingOnlyNameChange,
493 IEnumerable<OAuthConnection>? newOAuthConnections,
494 IEnumerable<OidcConnection>? newOidcConnections,
496 CancellationToken cancellationToken)
498 ArgumentNullException.ThrowIfNull(userAuthority);
501 casingOnlyNameChange,
527 [ID(nameof(
User))]
long id,
528 string? casingOnlyNameChange,
532 IEnumerable<OAuthConnection>? newOAuthConnections,
533 IEnumerable<OidcConnection>? newOidcConnections,
535 CancellationToken cancellationToken)
537 ArgumentNullException.ThrowIfNull(userAuthority);
540 casingOnlyNameChange,
566 [ID(nameof(
User))]
long id,
567 string? casingOnlyNameChange,
572 IEnumerable<OAuthConnection>? newOAuthConnections,
573 IEnumerable<OidcConnection>? newOidcConnections,
575 CancellationToken cancellationToken)
577 authority => authority.Update(
581 Name = casingOnlyNameChange,
582 Password = newPassword,
587 InstanceManagerRights = newPermissionSet.InstanceManagerRights,
588 AdministrationRights = newPermissionSet.AdministrationRights,
591 Group = newGroupId.HasValue
594 Id = newGroupId.Value,
597 OAuthConnections = newOAuthConnections
598 ?.Select(oAuthConnection =>
new Api.Models.OAuthConnection
600 ExternalUserId = oAuthConnection.ExternalUserId,
601 Provider = oAuthConnection.Provider,
604 OidcConnections = newOidcConnections
605 ?.Select(oidcConnection =>
new Api.Models.OidcConnection
607 ExternalUserId = oidcConnection.ExternalUserId,
608 SchemeKey = oidcConnection.SchemeKey,
virtual ? long Id
The ID of the entity.
Represents a group of users.
Represents a set of server permissions.
For editing a given user.
Exception representing ErrorMessageResponses.
Root type for GraphQL mutations.
const string GraphQLDescription
Description to show on the Mutation type.
IUserAuthority related Mutations.
ValueTask< UpdatedUser > CreateUserBySystemIDAndGroup(string systemIdentifier, bool? enabled, [ID(nameof(UserGroup))] long groupId, IEnumerable< OAuthConnection >? oAuthConnections, IEnumerable< OidcConnection >? oidcConnections, [Service] IGraphQLAuthorityInvoker< IUserAuthority > userAuthority, CancellationToken cancellationToken)
Creates a system user specifying the UserGroup they will belong to.
ValueTask< UpdatedUser > UpdateUser([ID(nameof(User))] long id, string? casingOnlyNameChange, string? newPassword, bool? enabled, IEnumerable< OAuthConnection >? newOAuthConnections, IEnumerable< OidcConnection >? newOidcConnections, [Service] IGraphQLAuthorityInvoker< IUserAuthority > userAuthority, CancellationToken cancellationToken)
Updates a Users properties.
ValueTask< UpdatedUser > CreateUserByServiceConnectionAndGroup(string name, IEnumerable< OAuthConnection > oAuthConnections, IEnumerable< OidcConnection > oidcConnections, [ID(nameof(UserGroup))] long groupId, bool? enabled, [Service] IGraphQLAuthorityInvoker< IUserAuthority > userAuthority, CancellationToken cancellationToken)
Creates a TGS user using OAuthConnections and/or OidcConnections specifying the UserGroup they will b...
ValueTask< UpdatedUser > CreateUserByServiceConnectionAndPermissionSet(string name, IEnumerable< OAuthConnection >? oAuthConnections, IEnumerable< OidcConnection >? oidcConnections, bool? enabled, PermissionSetInput? permissionSet, [Service] IGraphQLAuthorityInvoker< IUserAuthority > userAuthority, CancellationToken cancellationToken)
Creates a TGS user authenticated with one or more OAuthConnections or OidcConnections specifying a pe...
ValueTask< UpdatedUser > UpdateUserSetGroup([ID(nameof(User))] long id, string? casingOnlyNameChange, string? newPassword, bool? enabled, [ID(nameof(UserGroup))] long newGroupId, IEnumerable< OAuthConnection >? newOAuthConnections, IEnumerable< OidcConnection >? newOidcConnections, [Service] IGraphQLAuthorityInvoker< IUserAuthority > userAuthority, CancellationToken cancellationToken)
Updates a User, setting new values for its owned PermissionSet.
ValueTask< UpdatedUser > CreateUserBySystemIDAndPermissionSet(string systemIdentifier, bool? enabled, IEnumerable< OAuthConnection >? oAuthConnections, IEnumerable< OidcConnection >? oidcConnections, PermissionSetInput permissionSet, [Service] IGraphQLAuthorityInvoker< IUserAuthority > userAuthority, CancellationToken cancellationToken)
Creates a system user specifying a personal PermissionSet.
ValueTask< UpdatedUser > UpdateUserSetOwnedPermissionSet([ID(nameof(User))] long id, string? casingOnlyNameChange, string? newPassword, bool? enabled, PermissionSetInput newPermissionSet, IEnumerable< OAuthConnection >? newOAuthConnections, IEnumerable< OidcConnection >? newOidcConnections, [Service] IGraphQLAuthorityInvoker< IUserAuthority > userAuthority, CancellationToken cancellationToken)
Updates a User, setting new values for its owned PermissionSet.
ValueTask< UpdatedUser > CreateUserByPasswordAndGroup(string name, string password, bool? enabled, IEnumerable< OAuthConnection >? oAuthConnections, IEnumerable< OidcConnection >? oidcConnections, [ID(nameof(UserGroup))] long groupId, [Service] IGraphQLAuthorityInvoker< IUserAuthority > userAuthority, CancellationToken cancellationToken)
Creates a TGS user specifying the UserGroup they will belong to.
ValueTask< UpdatedUser > SetCurrentUserPassword(string newPassword, [Service] IAuthenticationContext authenticationContext, [Service] IGraphQLAuthorityInvoker< IUserAuthority > userAuthority, CancellationToken cancellationToken)
Sets the current user's password.
ValueTask< UpdatedUser > UpdateUserCore([ID(nameof(User))] long id, string? casingOnlyNameChange, string? newPassword, bool? enabled, PermissionSetInput? newPermissionSet, long? newGroupId, IEnumerable< OAuthConnection >? newOAuthConnections, IEnumerable< OidcConnection >? newOidcConnections, IGraphQLAuthorityInvoker< IUserAuthority > userAuthority, CancellationToken cancellationToken)
Updates a user.
ValueTask< UpdatedUser > UpdatedUser
ValueTask< UpdatedUser > SetCurrentServiceConnections(IEnumerable< OAuthConnection >? newOAuthConnections, IEnumerable< OidcConnection >? newOidcConnections, [Service] IAuthenticationContext authenticationContext, [Service] IGraphQLAuthorityInvoker< IUserAuthority > userAuthority, CancellationToken cancellationToken)
Sets the current user's OAuthConnections and OidcConnections.
ValueTask< UpdatedUser > CreateUserByPasswordAndPermissionSet(string name, string password, bool? enabled, IEnumerable< OAuthConnection >? oAuthConnections, IEnumerable< OidcConnection >? oidcConnections, PermissionSetInput? permissionSet, [Service] IGraphQLAuthorityInvoker< IUserAuthority > userAuthority, CancellationToken cancellationToken)
Creates a TGS user specifying a personal PermissionSet.
Represents a set of permissions for the server.
Represents a group of Users.
A user registered in the server.
Invokes TAuthority s from GraphQL endpoints.
For creating and accessing authentication contexts.
@ Id
Lookup the Api.Models.EntityId.Id of the Models.PermissionSet.
@ Enabled
The OAuth Gateway is enabled.