Files
server/src/Identity/IdentityServer/ApiResources.cs
Ike 96fe09af89 [PM-25415] move files into better place for code ownership (#6275)
* chore: move files into better place for code ownership

* fix: import correct namespace
2025-09-04 10:08:03 -04:00

43 lines
1.5 KiB
C#

using Bit.Core.Auth.Identity;
using Bit.Core.Auth.IdentityServer;
using Duende.IdentityModel;
using Duende.IdentityServer.Models;
namespace Bit.Identity.IdentityServer;
public class ApiResources
{
public static IEnumerable<ApiResource> GetApiResources()
{
return new List<ApiResource>
{
new("api", new[] {
JwtClaimTypes.Name,
JwtClaimTypes.Email,
JwtClaimTypes.EmailVerified,
Claims.SecurityStamp,
Claims.Premium,
Claims.Device,
Claims.DeviceType,
Claims.OrganizationOwner,
Claims.OrganizationAdmin,
Claims.OrganizationUser,
Claims.OrganizationCustom,
Claims.ProviderAdmin,
Claims.ProviderServiceUser,
Claims.SecretsManagerAccess
}),
new(ApiScopes.ApiSendAccess, [
JwtClaimTypes.Subject,
Claims.SendAccessClaims.SendId
]),
new(ApiScopes.Internal, new[] { JwtClaimTypes.Subject }),
new(ApiScopes.ApiPush, new[] { JwtClaimTypes.Subject }),
new(ApiScopes.ApiLicensing, new[] { JwtClaimTypes.Subject }),
new(ApiScopes.ApiOrganization, new[] { JwtClaimTypes.Subject }),
new(ApiScopes.ApiInstallation, new[] { JwtClaimTypes.Subject }),
new(ApiScopes.ApiSecrets, new[] { JwtClaimTypes.Subject, Claims.Organization }),
};
}
}