mirror of
https://github.com/bitwarden/server.git
synced 2025-07-05 18:12:48 -05:00
apikey apis for orgs
This commit is contained in:
@ -43,5 +43,6 @@ namespace Bit.Core.Services
|
||||
Task<OrganizationLicense> GenerateLicenseAsync(Organization organization, Guid installationId);
|
||||
Task ImportAsync(Guid organizationId, Guid importingUserId, IEnumerable<ImportedGroup> groups,
|
||||
IEnumerable<ImportedOrganizationUser> newUsers, IEnumerable<string> removeUserExternalIds);
|
||||
Task RotateApiKeyAsync(Organization organization);
|
||||
}
|
||||
}
|
||||
|
@ -1341,6 +1341,13 @@ namespace Bit.Core.Services
|
||||
}
|
||||
}
|
||||
|
||||
public async Task RotateApiKeyAsync(Organization organization)
|
||||
{
|
||||
organization.ApiKey = CoreHelpers.SecureRandomString(30);
|
||||
organization.RevisionDate = DateTime.UtcNow;
|
||||
await ReplaceAndUpdateCache(organization);
|
||||
}
|
||||
|
||||
private async Task UpdateUsersAsync(Group group, HashSet<string> groupUsers,
|
||||
Dictionary<string, Guid> existingUsersIdDict, HashSet<Guid> existingUsers = null)
|
||||
{
|
||||
|
Reference in New Issue
Block a user