@schemavaults/auth-common 0.41.3 → 0.43.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -25,10 +25,10 @@ export { getAuthServerUrl } from "@schemavaults/app-definitions";
25
25
  export { appIdSchema } from "@schemavaults/app-definitions";
26
26
  export { createAudienceSchema, createAudienceListSchema, createResourceUrlAudienceSchema, isResourceUrlAudience, RESOURCE_URL_AUDIENCE_MAX_LENGTH, } from "./audience-schema";
27
27
  export type { AudienceSchemaOverrides } from "./audience-schema";
28
- export { inviteCodeFormatSchema, inviteCodeDefinitionSchema, } from "./invite-code";
29
- export type { InviteCode, InviteCodeDefinition } from "./invite-code";
30
- export { organizationIdSchema, isValidOrganizationID, RESERVED_ORGANIZATION_IDS, organizationDefinitionSchema, getHardcodedOrgs, getAuthServerOwnerOrganizationId, DEFAULT_AUTH_SERVER_OWNER_ORGANIZATION_ID, getAuthServerOwnerOrganizationName, DEFAULT_AUTH_SERVER_OWNER_ORGANIZATION_NAME, MAXIMUM_USER_ORGANIZATIONS, MINIMUM_ORGANIZATION_ID_LENGTH, MAXIMUM_ORGANIZATION_ID_LENGTH, inviteMemberInputModes, inviteMemberFormSchema, assignableOrganizationMembershipRoles, assignableOrganizationMembershipRoleSchema, assignMemberFormSchema, organizationInvitationStatusTypes, organizationInvitationStatusSchema, organizationInvitationSchema, organizationMembershipRoleTypes, organizationMembershipRoleTypeSchema, isValidOrganizationMembershipRoleType, organizationMembershipRoleDetailsSchema, isValidOrganizationMembershipRoleDetails, } from "./organizations";
31
- export type { OrganizationID, OrganizationDefinition, InviteMemberInputMode, InviteMemberFormValues, InviteMemberSubmitData, AssignableOrganizationMembershipRole, AssignMemberFormValues, AssignMemberSubmitData, OrganizationInvitationStatus, OrganizationInvitation, UserPendingInvitation, OrganizationInvitationWithUserData, OrganizationMembershipRoleType, OrganizationMembershipRoleDetails, } from "./organizations";
28
+ export { inviteCodeFormatSchema, inviteCodeDefinitionSchema, inviteCodeRecordSchema, isInviteCodeRevoked, } from "./invite-code";
29
+ export type { InviteCode, InviteCodeDefinition, InviteCodeRecord, } from "./invite-code";
30
+ export { organizationIdSchema, isValidOrganizationID, RESERVED_ORGANIZATION_IDS, organizationDefinitionSchema, getHardcodedOrgs, getAuthServerOwnerOrganizationId, DEFAULT_AUTH_SERVER_OWNER_ORGANIZATION_ID, getAuthServerOwnerOrganizationName, DEFAULT_AUTH_SERVER_OWNER_ORGANIZATION_NAME, MAXIMUM_USER_ORGANIZATIONS, MINIMUM_ORGANIZATION_ID_LENGTH, MAXIMUM_ORGANIZATION_ID_LENGTH, inviteMemberInputModes, inviteMemberFormSchema, assignableOrganizationMembershipRoles, assignableOrganizationMembershipRoleSchema, assignMemberFormSchema, serviceAccountOrganizationMembershipRoles, serviceAccountOrganizationMembershipRoleSchema, isServiceAccountOrganizationMembershipRole, organizationInvitationStatusTypes, organizationInvitationStatusSchema, organizationInvitationSchema, organizationMembershipRoleTypes, organizationMembershipRoleTypeSchema, isValidOrganizationMembershipRoleType, organizationMembershipRoleDetailsSchema, isValidOrganizationMembershipRoleDetails, } from "./organizations";
31
+ export type { OrganizationID, OrganizationDefinition, InviteMemberInputMode, InviteMemberFormValues, InviteMemberSubmitData, AssignableOrganizationMembershipRole, AssignMemberFormValues, AssignMemberSubmitData, ServiceAccountOrganizationMembershipRole, OrganizationInvitationStatus, OrganizationInvitation, UserPendingInvitation, OrganizationInvitationWithUserData, OrganizationMembershipRoleType, OrganizationMembershipRoleDetails, } from "./organizations";
32
32
  export { MaximumBrowserCookieSize } from "./MaximumBrowserCookieSize";
33
33
  export { RefreshTokenCookieName, RefreshTokenExpiryCookieName, } from "./RefreshTokenCookieNames";
34
34
  export { AccessTokenCookieName, AccessTokenExpiryCookieName, } from "./AccessTokenCookieNames";
package/dist/index.js CHANGED
@@ -16,8 +16,8 @@ export { createRequestTokensResultSchema, createSuccessfullyGeneratedTokensRecor
16
16
  export { getAuthServerUrl } from "@schemavaults/app-definitions";
17
17
  export { appIdSchema } from "@schemavaults/app-definitions";
18
18
  export { createAudienceSchema, createAudienceListSchema, createResourceUrlAudienceSchema, isResourceUrlAudience, RESOURCE_URL_AUDIENCE_MAX_LENGTH, } from "./audience-schema";
19
- export { inviteCodeFormatSchema, inviteCodeDefinitionSchema, } from "./invite-code";
20
- export { organizationIdSchema, isValidOrganizationID, RESERVED_ORGANIZATION_IDS, organizationDefinitionSchema, getHardcodedOrgs, getAuthServerOwnerOrganizationId, DEFAULT_AUTH_SERVER_OWNER_ORGANIZATION_ID, getAuthServerOwnerOrganizationName, DEFAULT_AUTH_SERVER_OWNER_ORGANIZATION_NAME, MAXIMUM_USER_ORGANIZATIONS, MINIMUM_ORGANIZATION_ID_LENGTH, MAXIMUM_ORGANIZATION_ID_LENGTH, inviteMemberInputModes, inviteMemberFormSchema, assignableOrganizationMembershipRoles, assignableOrganizationMembershipRoleSchema, assignMemberFormSchema, organizationInvitationStatusTypes, organizationInvitationStatusSchema, organizationInvitationSchema, organizationMembershipRoleTypes, organizationMembershipRoleTypeSchema, isValidOrganizationMembershipRoleType, organizationMembershipRoleDetailsSchema, isValidOrganizationMembershipRoleDetails, } from "./organizations";
19
+ export { inviteCodeFormatSchema, inviteCodeDefinitionSchema, inviteCodeRecordSchema, isInviteCodeRevoked, } from "./invite-code";
20
+ export { organizationIdSchema, isValidOrganizationID, RESERVED_ORGANIZATION_IDS, organizationDefinitionSchema, getHardcodedOrgs, getAuthServerOwnerOrganizationId, DEFAULT_AUTH_SERVER_OWNER_ORGANIZATION_ID, getAuthServerOwnerOrganizationName, DEFAULT_AUTH_SERVER_OWNER_ORGANIZATION_NAME, MAXIMUM_USER_ORGANIZATIONS, MINIMUM_ORGANIZATION_ID_LENGTH, MAXIMUM_ORGANIZATION_ID_LENGTH, inviteMemberInputModes, inviteMemberFormSchema, assignableOrganizationMembershipRoles, assignableOrganizationMembershipRoleSchema, assignMemberFormSchema, serviceAccountOrganizationMembershipRoles, serviceAccountOrganizationMembershipRoleSchema, isServiceAccountOrganizationMembershipRole, organizationInvitationStatusTypes, organizationInvitationStatusSchema, organizationInvitationSchema, organizationMembershipRoleTypes, organizationMembershipRoleTypeSchema, isValidOrganizationMembershipRoleType, organizationMembershipRoleDetailsSchema, isValidOrganizationMembershipRoleDetails, } from "./organizations";
21
21
  export { MaximumBrowserCookieSize } from "./MaximumBrowserCookieSize";
22
22
  export { RefreshTokenCookieName, RefreshTokenExpiryCookieName, } from "./RefreshTokenCookieNames";
23
23
  export { AccessTokenCookieName, AccessTokenExpiryCookieName, } from "./AccessTokenCookieNames";
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,EACrB,cAAc,GACf,MAAM,8BAA8B,CAAC;AAGtC,OAAO,EACL,mCAAmC,EACnC,qCAAqC,GACtC,MAAM,gCAAgC,CAAC;AAExC,OAAO,EACL,cAAc,EACd,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,EAClB,uBAAuB,EAIvB,mBAAmB,EACnB,mBAAmB,EACnB,yBAAyB,EACzB,cAAc,EACd,oBAAoB,EACpB,kBAAkB,EAClB,qBAAqB,EACrB,sBAAsB,EACtB,8BAA8B,EAC9B,yBAAyB,GAK1B,MAAM,aAAa,CAAC;AAErB,cAAc,eAAe,CAAC;AAG9B,mBAAmB;AACnB,cAAc,cAAc,CAAC;AAM7B,cAAc,cAAc,CAAC;AAG7B,cAAc,QAAQ,CAAC;AAGvB,cAAc,QAAQ,CAAC;AAGvB,cAAc,cAAc,CAAC;AAE7B,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,iBAAiB,EACjB,sBAAsB,EACtB,sBAAsB,EACtB,4BAA4B,EAC5B,UAAU,EACV,WAAW,EACX,WAAW,EACX,YAAY,EACZ,UAAU,EACV,UAAU,EACV,WAAW,EACX,gBAAgB,EAChB,aAAa,GACd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B,oCAAoC,EACpC,qCAAqC,EACrC,uCAAuC,EACvC,wCAAwC,GACzC,MAAM,iBAAiB,CAAC;AAmBzB,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAEtE,OAAO,EACL,sBAAsB,EACtB,4BAA4B,GAC7B,MAAM,2BAA2B,CAAC;AAEnC,OAAO,EACL,qBAAqB,EACrB,2BAA2B,GAC5B,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,wCAAwC,EAAE,MAAM,4CAA4C,CAAC;AAEtG,OAAO,EAAE,kCAAkC,EAAE,MAAM,0CAA0C,CAAC;AAE9F,OAAO,EACL,uBAAuB,EACvB,6BAA6B,EAC7B,4BAA4B,EAC5B,wBAAwB,GACzB,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAC;AAEnE,OAAO,EACL,gBAAgB,EAChB,oBAAoB,GACrB,MAAM,sBAAsB,CAAC;AAE9B,OAAO,EAAE,qBAAqB,EAAE,MAAM,QAAQ,CAAC;AAE/C,OAAO,EACL,0BAA0B,EAC1B,uBAAuB,EACvB,qBAAqB,EACrB,sBAAsB,EACtB,wBAAwB,EACxB,uBAAuB,EACvB,qBAAqB,GACtB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EAAE,gCAAgC,EAAE,MAAM,UAAU,CAAC;AAE5D,OAAO,EACL,iBAAiB,EACjB,yBAAyB,EACzB,gBAAgB,EAChB,0BAA0B,GAC3B,MAAM,uBAAuB,CAAC"}
@@ -2,3 +2,5 @@ export { inviteCodeFormatSchema } from "./invite-code-format";
2
2
  export type { InviteCode } from "./invite-code-format";
3
3
  export { inviteCodeDefinitionSchema } from "./invite-code-definition";
4
4
  export type { InviteCodeDefinition } from "./invite-code-definition";
5
+ export { inviteCodeRecordSchema, isInviteCodeRevoked } from "./invite-code-record";
6
+ export type { InviteCodeRecord } from "./invite-code-record";
@@ -1,3 +1,4 @@
1
1
  export { inviteCodeFormatSchema } from "./invite-code-format";
2
2
  export { inviteCodeDefinitionSchema } from "./invite-code-definition";
3
+ export { inviteCodeRecordSchema, isInviteCodeRevoked } from "./invite-code-record";
3
4
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/invite-code/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAG9D,OAAO,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/invite-code/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAG9D,OAAO,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AAGtE,OAAO,EAAE,sBAAsB,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC"}
@@ -0,0 +1,26 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * An invite code as the auth server stores and lists it: its definition plus,
4
+ * once a platform administrator has revoked it, when and by whom.
5
+ *
6
+ * A revoked code can no longer be used to register. Revoking changes nothing
7
+ * else: `max_uses` keeps its value, and the accounts that registered with the
8
+ * code before keep it, so they still count as its usages.
9
+ *
10
+ * Only the server sets the revocation fields; `inviteCodeDefinitionSchema`
11
+ * (the body that creates a code) does not accept them.
12
+ */
13
+ export declare const inviteCodeRecordSchema: z.ZodObject<{
14
+ invite_code: z.ZodNonOptional<z.ZodString>;
15
+ created_at: z.ZodNonOptional<z.ZodNumber>;
16
+ max_uses: z.ZodNonOptional<z.ZodNumber>;
17
+ description: z.ZodOptional<z.ZodString>;
18
+ created_by: z.ZodOptional<z.ZodGUID>;
19
+ revoked_at: z.ZodOptional<z.ZodNumber>;
20
+ revoked_by: z.ZodOptional<z.ZodGUID>;
21
+ }, z.core.$strict>;
22
+ export type InviteCodeRecord = z.infer<typeof inviteCodeRecordSchema>;
23
+ /** Whether the invite code was revoked (`revoked_at` marks a revocation). */
24
+ export declare function isInviteCodeRevoked<T extends Pick<InviteCodeRecord, "revoked_at">>(invite_code: T): invite_code is T & {
25
+ revoked_at: number;
26
+ };
@@ -0,0 +1,29 @@
1
+ import { z } from "zod";
2
+ import { inviteCodeDefinitionSchema } from "./invite-code-definition";
3
+ /**
4
+ * An invite code as the auth server stores and lists it: its definition plus,
5
+ * once a platform administrator has revoked it, when and by whom.
6
+ *
7
+ * A revoked code can no longer be used to register. Revoking changes nothing
8
+ * else: `max_uses` keeps its value, and the accounts that registered with the
9
+ * code before keep it, so they still count as its usages.
10
+ *
11
+ * Only the server sets the revocation fields; `inviteCodeDefinitionSchema`
12
+ * (the body that creates a code) does not accept them.
13
+ */
14
+ export const inviteCodeRecordSchema = inviteCodeDefinitionSchema.extend({
15
+ revoked_at: z
16
+ .number()
17
+ .nonnegative()
18
+ .optional()
19
+ .describe("When the code was revoked (Unix epoch milliseconds); absent while it can still be used."),
20
+ revoked_by: z
21
+ .guid()
22
+ .optional()
23
+ .describe("uid of the administrator who revoked the code; absent when it is not revoked, or that account was deleted since."),
24
+ });
25
+ /** Whether the invite code was revoked (`revoked_at` marks a revocation). */
26
+ export function isInviteCodeRevoked(invite_code) {
27
+ return typeof invite_code.revoked_at === "number";
28
+ }
29
+ //# sourceMappingURL=invite-code-record.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invite-code-record.js","sourceRoot":"","sources":["../../src/invite-code/invite-code-record.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AAEtE;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,0BAA0B,CAAC,MAAM,CAAC;IACtE,UAAU,EAAE,CAAC;SACV,MAAM,EAAE;SACR,WAAW,EAAE;SACb,QAAQ,EAAE;SACV,QAAQ,CACP,yFAAyF,CAC1F;IACH,UAAU,EAAE,CAAC;SACV,IAAI,EAAE;SACN,QAAQ,EAAE;SACV,QAAQ,CACP,kHAAkH,CACnH;CACJ,CAAC,CAAC;AAIH,6EAA6E;AAC7E,MAAM,UAAU,mBAAmB,CAEjC,WAAc;IACd,OAAO,OAAO,WAAW,CAAC,UAAU,KAAK,QAAQ,CAAC;AACpD,CAAC"}
@@ -11,6 +11,8 @@ export { inviteMemberInputModes, inviteMemberFormSchema, } from "./invite_member
11
11
  export type { InviteMemberInputMode, InviteMemberFormValues, InviteMemberSubmitData, } from "./invite_member_form";
12
12
  export { assignableOrganizationMembershipRoles, assignableOrganizationMembershipRoleSchema, assignMemberFormSchema, } from "./assign_member_form";
13
13
  export type { AssignableOrganizationMembershipRole, AssignMemberFormValues, AssignMemberSubmitData, } from "./assign_member_form";
14
+ export { serviceAccountOrganizationMembershipRoles, serviceAccountOrganizationMembershipRoleSchema, isServiceAccountOrganizationMembershipRole, } from "./service_account_membership_role";
15
+ export type { ServiceAccountOrganizationMembershipRole } from "./service_account_membership_role";
14
16
  export { organizationInvitationStatusTypes, organizationInvitationStatusSchema, organizationInvitationSchema, } from "./organization_invitation";
15
17
  export type { OrganizationInvitationStatus, OrganizationInvitation, UserPendingInvitation, OrganizationInvitationWithUserData, } from "./organization_invitation";
16
18
  export { organizationMembershipRoleTypes, organizationMembershipRoleTypeSchema, isValidOrganizationMembershipRoleType, } from "./organization-membership-role-type";
@@ -6,6 +6,7 @@ export { getHardcodedOrgs } from "./hardcoded_orgs";
6
6
  export { MAXIMUM_USER_ORGANIZATIONS, MINIMUM_ORGANIZATION_ID_LENGTH, MAXIMUM_ORGANIZATION_ID_LENGTH, } from "./organization_constants";
7
7
  export { inviteMemberInputModes, inviteMemberFormSchema, } from "./invite_member_form";
8
8
  export { assignableOrganizationMembershipRoles, assignableOrganizationMembershipRoleSchema, assignMemberFormSchema, } from "./assign_member_form";
9
+ export { serviceAccountOrganizationMembershipRoles, serviceAccountOrganizationMembershipRoleSchema, isServiceAccountOrganizationMembershipRole, } from "./service_account_membership_role";
9
10
  export { organizationInvitationStatusTypes, organizationInvitationStatusSchema, organizationInvitationSchema, } from "./organization_invitation";
10
11
  export { organizationMembershipRoleTypes, organizationMembershipRoleTypeSchema, isValidOrganizationMembershipRoleType, } from "./organization-membership-role-type";
11
12
  export { organizationMembershipRoleDetailsSchema, isValidOrganizationMembershipRoleDetails, } from "./organization_membership_role_details";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/organizations/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACrB,yBAAyB,GAC1B,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AAGzE,OAAO,EACL,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EACL,gCAAgC,EAChC,yCAAyC,EACzC,kCAAkC,EAClC,2CAA2C,GAC5C,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEpD,OAAO,EACL,0BAA0B,EAC1B,8BAA8B,EAC9B,8BAA8B,GAC/B,MAAM,0BAA0B,CAAC;AAElC,OAAO,EACL,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,sBAAsB,CAAC;AAO9B,OAAO,EACL,qCAAqC,EACrC,0CAA0C,EAC1C,sBAAsB,GACvB,MAAM,sBAAsB,CAAC;AAO9B,OAAO,EACL,iCAAiC,EACjC,kCAAkC,EAClC,4BAA4B,GAC7B,MAAM,2BAA2B,CAAC;AAQnC,OAAO,EACL,+BAA+B,EAC/B,oCAAoC,EACpC,qCAAqC,GACtC,MAAM,qCAAqC,CAAC;AAG7C,OAAO,EACL,uCAAuC,EACvC,wCAAwC,GACzC,MAAM,wCAAwC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/organizations/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,qBAAqB,EACrB,yBAAyB,GAC1B,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AAGzE,OAAO,EACL,sBAAsB,EACtB,uBAAuB,GACxB,MAAM,qBAAqB,CAAC;AAG7B,OAAO,EACL,gCAAgC,EAChC,yCAAyC,EACzC,kCAAkC,EAClC,2CAA2C,GAC5C,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEpD,OAAO,EACL,0BAA0B,EAC1B,8BAA8B,EAC9B,8BAA8B,GAC/B,MAAM,0BAA0B,CAAC;AAElC,OAAO,EACL,sBAAsB,EACtB,sBAAsB,GACvB,MAAM,sBAAsB,CAAC;AAO9B,OAAO,EACL,qCAAqC,EACrC,0CAA0C,EAC1C,sBAAsB,GACvB,MAAM,sBAAsB,CAAC;AAO9B,OAAO,EACL,yCAAyC,EACzC,8CAA8C,EAC9C,0CAA0C,GAC3C,MAAM,mCAAmC,CAAC;AAG3C,OAAO,EACL,iCAAiC,EACjC,kCAAkC,EAClC,4BAA4B,GAC7B,MAAM,2BAA2B,CAAC;AAQnC,OAAO,EACL,+BAA+B,EAC/B,oCAAoC,EACpC,qCAAqC,GACtC,MAAM,qCAAqC,CAAC;AAG7C,OAAO,EACL,uCAAuC,EACvC,wCAAwC,GACzC,MAAM,wCAAwC,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * The roles the service account of an organization-owned client application
4
+ * may hold in the organization that owns the app (its virtual membership,
5
+ * `PUT /api/apps/{app_id}/service-account/organization-membership`): only
6
+ * `member`.
7
+ *
8
+ * Organization roles govern people. A service account is a machine
9
+ * credential: whoever holds the app's client secret acts as it, it cannot
10
+ * meet an organization's MFA requirement, and it is not listed among the
11
+ * organization's members. So it joins as a member only, and gets any further
12
+ * permission at a resource server from API scopes (the app's service-account
13
+ * scope allowance), which that API server's owner grants.
14
+ */
15
+ export declare const serviceAccountOrganizationMembershipRoles: readonly ["member"];
16
+ export type ServiceAccountOrganizationMembershipRole = (typeof serviceAccountOrganizationMembershipRoles)[number];
17
+ export declare const serviceAccountOrganizationMembershipRoleSchema: z.ZodEnum<{
18
+ member: "member";
19
+ }>;
20
+ export declare function isServiceAccountOrganizationMembershipRole(role: unknown): role is ServiceAccountOrganizationMembershipRole;
@@ -0,0 +1,21 @@
1
+ import { z } from "zod";
2
+ /**
3
+ * The roles the service account of an organization-owned client application
4
+ * may hold in the organization that owns the app (its virtual membership,
5
+ * `PUT /api/apps/{app_id}/service-account/organization-membership`): only
6
+ * `member`.
7
+ *
8
+ * Organization roles govern people. A service account is a machine
9
+ * credential: whoever holds the app's client secret acts as it, it cannot
10
+ * meet an organization's MFA requirement, and it is not listed among the
11
+ * organization's members. So it joins as a member only, and gets any further
12
+ * permission at a resource server from API scopes (the app's service-account
13
+ * scope allowance), which that API server's owner grants.
14
+ */
15
+ export const serviceAccountOrganizationMembershipRoles = ["member"];
16
+ export const serviceAccountOrganizationMembershipRoleSchema = z.enum(serviceAccountOrganizationMembershipRoles);
17
+ export function isServiceAccountOrganizationMembershipRole(role) {
18
+ return (typeof role === "string" &&
19
+ serviceAccountOrganizationMembershipRoles.includes(role));
20
+ }
21
+ //# sourceMappingURL=service_account_membership_role.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"service_account_membership_role.js","sourceRoot":"","sources":["../../src/organizations/service_account_membership_role.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,yCAAyC,GAAG,CAAC,QAAQ,CAAU,CAAC;AAK7E,MAAM,CAAC,MAAM,8CAA8C,GAAG,CAAC,CAAC,IAAI,CAClE,yCAAyC,CAC1C,CAAC;AAEF,MAAM,UAAU,0CAA0C,CACxD,IAAa;IAEb,OAAO,CACL,OAAO,IAAI,KAAK,QAAQ;QACvB,yCAA+D,CAAC,QAAQ,CACvE,IAAI,CACL,CACF,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@schemavaults/auth-common",
3
3
  "description": "Types and utility functions for authentication and authorization",
4
- "version": "0.41.3",
4
+ "version": "0.43.0",
5
5
  "license": "UNLICENSED",
6
6
  "private": false,
7
7
  "repository": {