@tearleads/client-sdk 0.1.15 → 0.1.17
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/client/Tearleads.d.ts +2 -0
- package/client/Tearleads.js +1 -0
- package/client/Tearleads.js.map +1 -1
- package/client/index.d.ts +1 -1
- package/client/index.js.map +1 -1
- package/client/organizations/currentPrincipalMutations.js +96 -0
- package/client/organizations/currentPrincipalMutations.js.map +1 -0
- package/client/organizations/index.d.ts +4 -42
- package/client/organizations/index.js +17 -3
- package/client/organizations/index.js.map +1 -1
- package/client/organizations/organizationGroupHistory.js +44 -0
- package/client/organizations/organizationGroupHistory.js.map +1 -0
- package/client/organizations/organizationGroupNameHydration.js +14 -1
- package/client/organizations/organizationGroupNameHydration.js.map +1 -1
- package/client/organizations/organizationGroupPresentation.d.ts +1 -0
- package/client/organizations/organizationGroupPresentation.js +16 -2
- package/client/organizations/organizationGroupPresentation.js.map +1 -1
- package/client/organizations/organizationReadModels.d.ts +1 -1
- package/client/organizations/organizationReadModels.js +11 -1
- package/client/organizations/organizationReadModels.js.map +1 -1
- package/client/organizations/organizationsTypes.d.ts +50 -0
- package/client/organizations/organizationsTypes.js +2 -0
- package/client/organizations/organizationsTypes.js.map +1 -0
- package/client/organizations/principalContainerMutations.js +2 -0
- package/client/organizations/principalContainerMutations.js.map +1 -1
- package/client/organizations/principalMutationRecovery.d.ts +16 -0
- package/client/organizations/principalMutationRecovery.js +23 -0
- package/client/organizations/principalMutationRecovery.js.map +1 -0
- package/client/organizations/principalMutationScope.js +7 -2
- package/client/organizations/principalMutationScope.js.map +1 -1
- package/client/organizations/principalMutations.d.ts +4 -308
- package/client/organizations/principalMutations.js +165 -87
- package/client/organizations/principalMutations.js.map +1 -1
- package/client/principalMutationApi.d.ts +24 -0
- package/client/principalMutationApi.js +108 -0
- package/client/principalMutationApi.js.map +1 -0
- package/client/principalMutationDeadline.js +23 -0
- package/client/principalMutationDeadline.js.map +1 -0
- package/client/workflowRuntime.d.ts +3 -1
- package/client/workflowRuntime.js +44 -5
- package/client/workflowRuntime.js.map +1 -1
- package/data/persistence/principalCurrentAcknowledgementPersistence.d.ts +27 -0
- package/data/persistence/principalCurrentAcknowledgementPersistence.js +116 -0
- package/data/persistence/principalCurrentAcknowledgementPersistence.js.map +1 -0
- package/data/persistence/principalGrantRetirementPersistence.d.ts +3 -3
- package/data/persistence/principalGrantRetirementPersistence.js +4 -1
- package/data/persistence/principalGrantRetirementPersistence.js.map +1 -1
- package/data/persistence/principalKeyEnvelopeCandidates.js +12 -1
- package/data/persistence/principalKeyEnvelopeCandidates.js.map +1 -1
- package/data/persistence/principalMutationJournalPersistence.d.ts +19 -0
- package/data/persistence/principalMutationJournalPersistence.js +53 -0
- package/data/persistence/principalMutationJournalPersistence.js.map +1 -0
- package/data/persistence/verifiedPrincipalPolicyBundle.js +7 -51
- package/data/persistence/verifiedPrincipalPolicyBundle.js.map +1 -1
- package/data/persistence/verifiedPrincipalPolicyCurrent.js +56 -0
- package/data/persistence/verifiedPrincipalPolicyCurrent.js.map +1 -0
- package/data/principals/currentPolicyReferenceResolver.js +2 -0
- package/data/principals/currentPolicyReferenceResolver.js.map +1 -0
- package/data/principals/principalHistoryScopeProtection.js +23 -0
- package/data/principals/principalHistoryScopeProtection.js.map +1 -0
- package/data/principals/principalMutationJournal.d.ts +26 -0
- package/data/principals/principalMutationJournal.js +90 -0
- package/data/principals/principalMutationJournal.js.map +1 -0
- package/data/principals/principalMutationJournalRecord.d.ts +8 -0
- package/data/principals/principalMutationJournalRecord.js +25 -0
- package/data/principals/principalMutationJournalRecord.js.map +1 -0
- package/data/principals/principalPolicyAdminSigners.js.map +1 -1
- package/data/sqlite/principalHistoryStageSchema.js +3 -0
- package/data/sqlite/principalHistoryStageSchema.js.map +1 -1
- package/data/sqlite/principalMutationJournalSchema.d.ts +85 -0
- package/data/sqlite/principalMutationJournalSchema.js +13 -0
- package/data/sqlite/principalMutationJournalSchema.js.map +1 -0
- package/data/sqlite/schema.d.ts +83 -0
- package/data/sqlite/schema.js +3 -0
- package/data/sqlite/schema.js.map +1 -1
- package/index.d.ts +3 -3
- package/index.js +1 -1
- package/index.js.map +1 -1
- package/internal/crypto/index.d.ts +1 -1
- package/internal/crypto/index.js +1 -1
- package/internal/crypto/index.js.map +1 -1
- package/internal/crypto/keying/index.d.ts +3 -0
- package/internal/crypto/keying/index.js +3 -0
- package/internal/crypto/keying/index.js.map +1 -1
- package/internal/crypto/keying/principalPolicyCurrent.d.ts +1 -1
- package/internal/crypto/keying/principalPolicyCurrent.js +3 -3
- package/internal/crypto/keying/principalPolicyCurrent.js.map +1 -1
- package/internal/crypto/keying/principalPolicyCurrentEvidence.js +16 -0
- package/internal/crypto/keying/principalPolicyCurrentEvidence.js.map +1 -0
- package/internal/crypto/keying/principalPolicyCurrentMutation.d.ts +10 -0
- package/internal/crypto/keying/principalPolicyCurrentMutation.js +51 -0
- package/internal/crypto/keying/principalPolicyCurrentMutation.js.map +1 -0
- package/internal/crypto/keying/principalPolicyCurrentPredecessorReferences.d.ts +8 -0
- package/internal/crypto/keying/principalPolicyCurrentPredecessorReferences.js +46 -0
- package/internal/crypto/keying/principalPolicyCurrentPredecessorReferences.js.map +1 -0
- package/internal/crypto/keying/principalPolicyCurrentSuccessor.d.ts +10 -0
- package/internal/crypto/keying/principalPolicyCurrentSuccessor.js +60 -0
- package/internal/crypto/keying/principalPolicyCurrentSuccessor.js.map +1 -0
- package/internal/crypto/keying/principalPolicyHistory.js +4 -1
- package/internal/crypto/keying/principalPolicyHistory.js.map +1 -1
- package/internal/crypto/keying/principalPolicyHistoryReferences.js +1 -1
- package/internal/crypto/keying/principalPolicyHistoryReferences.js.map +1 -1
- package/internal/crypto/keying/principalPolicyHistoryTypes.d.ts +5 -2
- package/internal/crypto/keying/principalPolicyHistoryTypes.js +6 -3
- package/internal/crypto/keying/principalPolicyHistoryTypes.js.map +1 -1
- package/package.json +1 -1
- package/workflows/containers/child/carriedDescendantRekeys.js +9 -1
- package/workflows/containers/child/carriedDescendantRekeys.js.map +1 -1
- package/workflows/containers/child/replacementPrincipalPolicyReferences.js +19 -0
- package/workflows/containers/child/replacementPrincipalPolicyReferences.js.map +1 -0
- package/workflows/containers/child/share.js +4 -0
- package/workflows/containers/child/share.js.map +1 -1
- package/workflows/containers/child/sharePrincipalPolicy.d.ts +1 -0
- package/workflows/containers/child/sharePrincipalPolicy.js.map +1 -1
- package/workflows/organizations/acknowledgedDirectoryBindings.js +18 -0
- package/workflows/organizations/acknowledgedDirectoryBindings.js.map +1 -0
- package/workflows/organizations/commitCurrentGroupPolicyMutation.js +72 -0
- package/workflows/organizations/commitCurrentGroupPolicyMutation.js.map +1 -0
- package/workflows/organizations/createCurrentOrganizationGroup.js +85 -0
- package/workflows/organizations/createCurrentOrganizationGroup.js.map +1 -0
- package/workflows/organizations/currentGroupMetadataAuthority.js +53 -0
- package/workflows/organizations/currentGroupMetadataAuthority.js.map +1 -0
- package/workflows/organizations/currentGroupMutationReferences.js +35 -0
- package/workflows/organizations/currentGroupMutationReferences.js.map +1 -0
- package/workflows/organizations/currentGroupPolicyMutationContext.js +79 -0
- package/workflows/organizations/currentGroupPolicyMutationContext.js.map +1 -0
- package/workflows/organizations/currentOrganizationAuthority.js +88 -0
- package/workflows/organizations/currentOrganizationAuthority.js.map +1 -0
- package/workflows/organizations/currentOrganizationGroupNames.js +72 -0
- package/workflows/organizations/currentOrganizationGroupNames.js.map +1 -0
- package/workflows/organizations/currentOrganizationMutationAuthority.js +16 -0
- package/workflows/organizations/currentOrganizationMutationAuthority.js.map +1 -0
- package/workflows/organizations/currentOrganizationMutationRetention.js +53 -0
- package/workflows/organizations/currentOrganizationMutationRetention.js.map +1 -0
- package/workflows/organizations/currentPolicyMutationAcknowledgement.js +65 -0
- package/workflows/organizations/currentPolicyMutationAcknowledgement.js.map +1 -0
- package/workflows/organizations/currentPrincipalMutationLease.js +38 -0
- package/workflows/organizations/currentPrincipalMutationLease.js.map +1 -0
- package/workflows/organizations/deleteCurrentOrganizationGroup.js +35 -0
- package/workflows/organizations/deleteCurrentOrganizationGroup.js.map +1 -0
- package/workflows/organizations/deleteOrganizationGroup.d.ts +1 -0
- package/workflows/organizations/deleteOrganizationGroup.js +11 -0
- package/workflows/organizations/deleteOrganizationGroup.js.map +1 -1
- package/workflows/organizations/groupCreation.d.ts +1 -0
- package/workflows/organizations/groupCreation.js +9 -0
- package/workflows/organizations/groupCreation.js.map +1 -1
- package/workflows/organizations/groupMembershipName.d.ts +1 -1
- package/workflows/organizations/groupMembershipName.js.map +1 -1
- package/workflows/organizations/groupMetadataAccess.d.ts +2 -2
- package/workflows/organizations/groupMetadataAccess.js +1 -1
- package/workflows/organizations/groupMetadataAccess.js.map +1 -1
- package/workflows/organizations/groupMetadataBinding.js.map +1 -1
- package/workflows/organizations/groupMetadataContainerAuthority.js +2 -47
- package/workflows/organizations/groupMetadataContainerAuthority.js.map +1 -1
- package/workflows/organizations/groupMetadataRootBinding.js +51 -0
- package/workflows/organizations/groupMetadataRootBinding.js.map +1 -0
- package/workflows/organizations/groupMetadataRuntime.js +26 -10
- package/workflows/organizations/groupMetadataRuntime.js.map +1 -1
- package/workflows/organizations/groupMutationAuthorization.js.map +1 -1
- package/workflows/organizations/groupNameUniqueness.js +1 -1
- package/workflows/organizations/groupNameUniqueness.js.map +1 -1
- package/workflows/organizations/groupPolicyHistoryPage.js +31 -0
- package/workflows/organizations/groupPolicyHistoryPage.js.map +1 -0
- package/workflows/organizations/groupPolicyMutationAcknowledgement.js +10 -75
- package/workflows/organizations/groupPolicyMutationAcknowledgement.js.map +1 -1
- package/workflows/organizations/groupPolicyMutationContext.d.ts +23 -13
- package/workflows/organizations/groupPolicyMutationContext.js +2 -1
- package/workflows/organizations/groupPolicyMutationContext.js.map +1 -1
- package/workflows/organizations/groupPolicyMutationEvidence.d.ts +26 -0
- package/workflows/organizations/groupPolicyMutationEvidence.js +64 -0
- package/workflows/organizations/groupPolicyMutationEvidence.js.map +1 -0
- package/workflows/organizations/groupPolicyMutationHead.js.map +1 -1
- package/workflows/organizations/groupPolicyRequests.js +69 -63
- package/workflows/organizations/groupPolicyRequests.js.map +1 -1
- package/workflows/organizations/index.d.ts +6 -0
- package/workflows/organizations/index.js +5 -0
- package/workflows/organizations/index.js.map +1 -1
- package/workflows/organizations/initialPrincipalCurrentPublication.js +83 -0
- package/workflows/organizations/initialPrincipalCurrentPublication.js.map +1 -0
- package/workflows/organizations/organizationGroupDirectory.js +6 -0
- package/workflows/organizations/organizationGroupDirectory.js.map +1 -1
- package/workflows/organizations/organizationGroupNames.js +7 -0
- package/workflows/organizations/organizationGroupNames.js.map +1 -1
- package/workflows/organizations/policyHistoryTypes.d.ts +2 -0
- package/workflows/organizations/policyHistoryTypes.js.map +1 -1
- package/workflows/organizations/principalContainerRematerialization.js +12 -2
- package/workflows/organizations/principalContainerRematerialization.js.map +1 -1
- package/workflows/organizations/principalContainerRematerializationPlanning.js +1 -0
- package/workflows/organizations/principalContainerRematerializationPlanning.js.map +1 -1
- package/workflows/organizations/principalContainerRematerializationTargets.js.map +1 -1
- package/workflows/organizations/principalCurrentPublicationSeal.js +51 -0
- package/workflows/organizations/principalCurrentPublicationSeal.js.map +1 -0
- package/workflows/organizations/principalMutationJournalLane.js +26 -0
- package/workflows/organizations/principalMutationJournalLane.js.map +1 -0
- package/workflows/organizations/principalMutationJournalManagement.d.ts +26 -0
- package/workflows/organizations/principalMutationJournalManagement.js +104 -0
- package/workflows/organizations/principalMutationJournalManagement.js.map +1 -0
- package/workflows/organizations/principalMutationJournalSession.d.ts +26 -0
- package/workflows/organizations/principalMutationJournalSession.js +85 -0
- package/workflows/organizations/principalMutationJournalSession.js.map +1 -0
- package/workflows/organizations/principalMutationReceipt.js +21 -0
- package/workflows/organizations/principalMutationReceipt.js.map +1 -0
- package/workflows/organizations/principalPolicyReceiptArtifacts.js +74 -0
- package/workflows/organizations/principalPolicyReceiptArtifacts.js.map +1 -0
- package/workflows/organizations/principalPolicyRequest.d.ts +5 -4
- package/workflows/organizations/principalPolicyRequest.js.map +1 -1
- package/workflows/organizations/retainAcknowledgedPrincipalCurrents.d.ts +23 -0
- package/workflows/organizations/retainAcknowledgedPrincipalCurrents.js +159 -0
- package/workflows/organizations/retainAcknowledgedPrincipalCurrents.js.map +1 -0
- package/workflows/organizations/runtimeCurrentGroupMutation.js +85 -0
- package/workflows/organizations/runtimeCurrentGroupMutation.js.map +1 -0
- package/workflows/organizations/runtimeCurrentOrganizationMutation.js +48 -0
- package/workflows/organizations/runtimeCurrentOrganizationMutation.js.map +1 -0
- package/workflows/principals/loadRecoveredPrincipalHistoryPage.d.ts +11 -0
- package/workflows/principals/loadRecoveredPrincipalHistoryPage.js +120 -0
- package/workflows/principals/loadRecoveredPrincipalHistoryPage.js.map +1 -0
- package/workflows/principals/principalCurrentRecoveryBatch.js +14 -0
- package/workflows/principals/principalCurrentRecoveryBatch.js.map +1 -0
- package/workflows/principals/principalHistoryRecoveryReferences.js +8 -0
- package/workflows/principals/principalHistoryRecoveryReferences.js.map +1 -1
- package/workflows/principals/principalRecoveryDirectory.d.ts +1 -1
- package/workflows/principals/principalRecoveryDirectory.js +32 -12
- package/workflows/principals/principalRecoveryDirectory.js.map +1 -1
- package/workflows/principals/principalRecoveryDiscoveryPage.js +36 -0
- package/workflows/principals/principalRecoveryDiscoveryPage.js.map +1 -0
- package/workflows/principals/principalRecoveryLocalPreference.js +29 -0
- package/workflows/principals/principalRecoveryLocalPreference.js.map +1 -0
- package/workflows/principals/principalRecoveryMemo.d.ts +16 -0
- package/workflows/principals/principalRecoveryMemo.js +88 -16
- package/workflows/principals/principalRecoveryMemo.js.map +1 -1
- package/workflows/principals/recoverCurrentOrganizationPolicy.js +33 -0
- package/workflows/principals/recoverCurrentOrganizationPolicy.js.map +1 -0
- package/workflows/principals/recoverPrincipalHistoryPage.js +30 -0
- package/workflows/principals/recoverPrincipalHistoryPage.js.map +1 -0
- package/workflows/principals/recoverPrincipalPolicyHistory.d.ts +2 -0
- package/workflows/principals/recoverPrincipalPolicyHistory.js +14 -2
- package/workflows/principals/recoverPrincipalPolicyHistory.js.map +1 -1
- package/workflows/principals/recoverScopedPrincipalPolicyHistory.d.ts +8 -1
- package/workflows/principals/recoverScopedPrincipalPolicyHistory.js +30 -20
- package/workflows/principals/recoverScopedPrincipalPolicyHistory.js.map +1 -1
- package/workflows/principals/runtimePolicyRecovery.js +36 -9
- package/workflows/principals/runtimePolicyRecovery.js.map +1 -1
- package/workflows/principals/runtimePolicyWarmer.js +2 -2
- package/workflows/principals/runtimePolicyWarmer.js.map +1 -1
|
@@ -24,108 +24,6 @@ interface PrincipalMutationRuntime {
|
|
|
24
24
|
readonly runtime: InternalWorkflowRuntimeInput;
|
|
25
25
|
}
|
|
26
26
|
export declare function addUserToOrganizationGroup(input: PrincipalMutationRuntime & AddOrganizationGroupUserInput): Promise<{
|
|
27
|
-
previousStates: {
|
|
28
|
-
grants: {
|
|
29
|
-
accessLevel: "admin" | "read" | "write";
|
|
30
|
-
containerId: string;
|
|
31
|
-
}[];
|
|
32
|
-
projection: {
|
|
33
|
-
role: "member" | "admin";
|
|
34
|
-
userId: string;
|
|
35
|
-
}[];
|
|
36
|
-
state: {
|
|
37
|
-
createdAt: string;
|
|
38
|
-
encapsulationPublicKey: string;
|
|
39
|
-
externalAuthority: {
|
|
40
|
-
keyEpoch: number;
|
|
41
|
-
keyFingerprint: string;
|
|
42
|
-
principalId: string;
|
|
43
|
-
principalType: "group";
|
|
44
|
-
stateHash: string;
|
|
45
|
-
version: number;
|
|
46
|
-
} | null;
|
|
47
|
-
grantCount: number;
|
|
48
|
-
grantRoot: string;
|
|
49
|
-
keyEpoch: number;
|
|
50
|
-
keyFingerprint: string;
|
|
51
|
-
memberCount: number;
|
|
52
|
-
memberEnvelopesRoot: string;
|
|
53
|
-
membershipMode: "projection";
|
|
54
|
-
membershipRoot: string;
|
|
55
|
-
payloadCiphertextHash: string;
|
|
56
|
-
prevStateHash: string | null;
|
|
57
|
-
principalId: string;
|
|
58
|
-
principalType: "group" | "organization";
|
|
59
|
-
projectionRoot: string;
|
|
60
|
-
signature: string;
|
|
61
|
-
signedAt: string;
|
|
62
|
-
signerUserId: string;
|
|
63
|
-
signerUserKeyFingerprint: string;
|
|
64
|
-
stateHash: string;
|
|
65
|
-
version: number;
|
|
66
|
-
};
|
|
67
|
-
}[];
|
|
68
|
-
currentGrants: {
|
|
69
|
-
accessLevel: "admin" | "read" | "write";
|
|
70
|
-
containerId: string;
|
|
71
|
-
}[];
|
|
72
|
-
currentMemberEnvelopes: {
|
|
73
|
-
envelopes: {
|
|
74
|
-
kemCipherText: string;
|
|
75
|
-
memberKeyFingerprint: string;
|
|
76
|
-
userId: string;
|
|
77
|
-
wrappedKey: string;
|
|
78
|
-
}[];
|
|
79
|
-
epoch: number;
|
|
80
|
-
principalId: string;
|
|
81
|
-
principalType: "group" | "organization";
|
|
82
|
-
stateHash: string;
|
|
83
|
-
};
|
|
84
|
-
currentPayload: {
|
|
85
|
-
cipherSuite: "aes-256-gcm";
|
|
86
|
-
ciphertext: string;
|
|
87
|
-
ciphertextHash: string;
|
|
88
|
-
createdAt: string;
|
|
89
|
-
principalId: string;
|
|
90
|
-
principalType: "group" | "organization";
|
|
91
|
-
stateHash: string;
|
|
92
|
-
};
|
|
93
|
-
currentProjection: {
|
|
94
|
-
role: "member" | "admin";
|
|
95
|
-
userId: string;
|
|
96
|
-
}[];
|
|
97
|
-
currentState: {
|
|
98
|
-
createdAt: string;
|
|
99
|
-
encapsulationPublicKey: string;
|
|
100
|
-
externalAuthority: {
|
|
101
|
-
keyEpoch: number;
|
|
102
|
-
keyFingerprint: string;
|
|
103
|
-
principalId: string;
|
|
104
|
-
principalType: "group";
|
|
105
|
-
stateHash: string;
|
|
106
|
-
version: number;
|
|
107
|
-
} | null;
|
|
108
|
-
grantCount: number;
|
|
109
|
-
grantRoot: string;
|
|
110
|
-
keyEpoch: number;
|
|
111
|
-
keyFingerprint: string;
|
|
112
|
-
memberCount: number;
|
|
113
|
-
memberEnvelopesRoot: string;
|
|
114
|
-
membershipMode: "projection";
|
|
115
|
-
membershipRoot: string;
|
|
116
|
-
payloadCiphertextHash: string;
|
|
117
|
-
prevStateHash: string | null;
|
|
118
|
-
principalId: string;
|
|
119
|
-
principalType: "group" | "organization";
|
|
120
|
-
projectionRoot: string;
|
|
121
|
-
signature: string;
|
|
122
|
-
signedAt: string;
|
|
123
|
-
signerUserId: string;
|
|
124
|
-
signerUserKeyFingerprint: string;
|
|
125
|
-
stateHash: string;
|
|
126
|
-
version: number;
|
|
127
|
-
};
|
|
128
|
-
} & {
|
|
129
27
|
containerMutations: {
|
|
130
28
|
createdAt: string;
|
|
131
29
|
manifestHead: {
|
|
@@ -250,10 +148,12 @@ export declare function addUserToOrganizationGroup(input: PrincipalMutationRunti
|
|
|
250
148
|
export declare function createGroupForOrganization(input: {
|
|
251
149
|
readonly name: string;
|
|
252
150
|
readonly runtime: InternalWorkflowRuntimeInput;
|
|
151
|
+
readonly stillCurrent: () => boolean;
|
|
253
152
|
}): Promise<import("./index.js").OrganizationGroupSummary>;
|
|
254
153
|
export declare function deleteGroupForOrganization(input: {
|
|
255
154
|
readonly groupId: string;
|
|
256
155
|
readonly runtime: InternalWorkflowRuntimeInput;
|
|
156
|
+
readonly stillCurrent: () => boolean;
|
|
257
157
|
}): Promise<{
|
|
258
158
|
deleted: true;
|
|
259
159
|
groupId: string;
|
|
@@ -382,108 +282,6 @@ export declare function deleteGroupForOrganization(input: {
|
|
|
382
282
|
organizationId: string;
|
|
383
283
|
}>;
|
|
384
284
|
export declare function removeUserFromOrganizationGroup(input: PrincipalMutationRuntime & RemoveOrganizationGroupUserInput): Promise<{
|
|
385
|
-
previousStates: {
|
|
386
|
-
grants: {
|
|
387
|
-
accessLevel: "admin" | "read" | "write";
|
|
388
|
-
containerId: string;
|
|
389
|
-
}[];
|
|
390
|
-
projection: {
|
|
391
|
-
role: "member" | "admin";
|
|
392
|
-
userId: string;
|
|
393
|
-
}[];
|
|
394
|
-
state: {
|
|
395
|
-
createdAt: string;
|
|
396
|
-
encapsulationPublicKey: string;
|
|
397
|
-
externalAuthority: {
|
|
398
|
-
keyEpoch: number;
|
|
399
|
-
keyFingerprint: string;
|
|
400
|
-
principalId: string;
|
|
401
|
-
principalType: "group";
|
|
402
|
-
stateHash: string;
|
|
403
|
-
version: number;
|
|
404
|
-
} | null;
|
|
405
|
-
grantCount: number;
|
|
406
|
-
grantRoot: string;
|
|
407
|
-
keyEpoch: number;
|
|
408
|
-
keyFingerprint: string;
|
|
409
|
-
memberCount: number;
|
|
410
|
-
memberEnvelopesRoot: string;
|
|
411
|
-
membershipMode: "projection";
|
|
412
|
-
membershipRoot: string;
|
|
413
|
-
payloadCiphertextHash: string;
|
|
414
|
-
prevStateHash: string | null;
|
|
415
|
-
principalId: string;
|
|
416
|
-
principalType: "group" | "organization";
|
|
417
|
-
projectionRoot: string;
|
|
418
|
-
signature: string;
|
|
419
|
-
signedAt: string;
|
|
420
|
-
signerUserId: string;
|
|
421
|
-
signerUserKeyFingerprint: string;
|
|
422
|
-
stateHash: string;
|
|
423
|
-
version: number;
|
|
424
|
-
};
|
|
425
|
-
}[];
|
|
426
|
-
currentGrants: {
|
|
427
|
-
accessLevel: "admin" | "read" | "write";
|
|
428
|
-
containerId: string;
|
|
429
|
-
}[];
|
|
430
|
-
currentMemberEnvelopes: {
|
|
431
|
-
envelopes: {
|
|
432
|
-
kemCipherText: string;
|
|
433
|
-
memberKeyFingerprint: string;
|
|
434
|
-
userId: string;
|
|
435
|
-
wrappedKey: string;
|
|
436
|
-
}[];
|
|
437
|
-
epoch: number;
|
|
438
|
-
principalId: string;
|
|
439
|
-
principalType: "group" | "organization";
|
|
440
|
-
stateHash: string;
|
|
441
|
-
};
|
|
442
|
-
currentPayload: {
|
|
443
|
-
cipherSuite: "aes-256-gcm";
|
|
444
|
-
ciphertext: string;
|
|
445
|
-
ciphertextHash: string;
|
|
446
|
-
createdAt: string;
|
|
447
|
-
principalId: string;
|
|
448
|
-
principalType: "group" | "organization";
|
|
449
|
-
stateHash: string;
|
|
450
|
-
};
|
|
451
|
-
currentProjection: {
|
|
452
|
-
role: "member" | "admin";
|
|
453
|
-
userId: string;
|
|
454
|
-
}[];
|
|
455
|
-
currentState: {
|
|
456
|
-
createdAt: string;
|
|
457
|
-
encapsulationPublicKey: string;
|
|
458
|
-
externalAuthority: {
|
|
459
|
-
keyEpoch: number;
|
|
460
|
-
keyFingerprint: string;
|
|
461
|
-
principalId: string;
|
|
462
|
-
principalType: "group";
|
|
463
|
-
stateHash: string;
|
|
464
|
-
version: number;
|
|
465
|
-
} | null;
|
|
466
|
-
grantCount: number;
|
|
467
|
-
grantRoot: string;
|
|
468
|
-
keyEpoch: number;
|
|
469
|
-
keyFingerprint: string;
|
|
470
|
-
memberCount: number;
|
|
471
|
-
memberEnvelopesRoot: string;
|
|
472
|
-
membershipMode: "projection";
|
|
473
|
-
membershipRoot: string;
|
|
474
|
-
payloadCiphertextHash: string;
|
|
475
|
-
prevStateHash: string | null;
|
|
476
|
-
principalId: string;
|
|
477
|
-
principalType: "group" | "organization";
|
|
478
|
-
projectionRoot: string;
|
|
479
|
-
signature: string;
|
|
480
|
-
signedAt: string;
|
|
481
|
-
signerUserId: string;
|
|
482
|
-
signerUserKeyFingerprint: string;
|
|
483
|
-
stateHash: string;
|
|
484
|
-
version: number;
|
|
485
|
-
};
|
|
486
|
-
} & {
|
|
487
285
|
containerMutations: {
|
|
488
286
|
createdAt: string;
|
|
489
287
|
manifestHead: {
|
|
@@ -664,109 +462,7 @@ export declare function revokeOrganizationGrant(input: PrincipalMutationRuntime
|
|
|
664
462
|
wraps: Record<string, unknown>[];
|
|
665
463
|
};
|
|
666
464
|
systemSlot?: string | null | undefined;
|
|
667
|
-
} |
|
|
668
|
-
previousStates: {
|
|
669
|
-
grants: {
|
|
670
|
-
accessLevel: "admin" | "read" | "write";
|
|
671
|
-
containerId: string;
|
|
672
|
-
}[];
|
|
673
|
-
projection: {
|
|
674
|
-
role: "member" | "admin";
|
|
675
|
-
userId: string;
|
|
676
|
-
}[];
|
|
677
|
-
state: {
|
|
678
|
-
createdAt: string;
|
|
679
|
-
encapsulationPublicKey: string;
|
|
680
|
-
externalAuthority: {
|
|
681
|
-
keyEpoch: number;
|
|
682
|
-
keyFingerprint: string;
|
|
683
|
-
principalId: string;
|
|
684
|
-
principalType: "group";
|
|
685
|
-
stateHash: string;
|
|
686
|
-
version: number;
|
|
687
|
-
} | null;
|
|
688
|
-
grantCount: number;
|
|
689
|
-
grantRoot: string;
|
|
690
|
-
keyEpoch: number;
|
|
691
|
-
keyFingerprint: string;
|
|
692
|
-
memberCount: number;
|
|
693
|
-
memberEnvelopesRoot: string;
|
|
694
|
-
membershipMode: "projection";
|
|
695
|
-
membershipRoot: string;
|
|
696
|
-
payloadCiphertextHash: string;
|
|
697
|
-
prevStateHash: string | null;
|
|
698
|
-
principalId: string;
|
|
699
|
-
principalType: "group" | "organization";
|
|
700
|
-
projectionRoot: string;
|
|
701
|
-
signature: string;
|
|
702
|
-
signedAt: string;
|
|
703
|
-
signerUserId: string;
|
|
704
|
-
signerUserKeyFingerprint: string;
|
|
705
|
-
stateHash: string;
|
|
706
|
-
version: number;
|
|
707
|
-
};
|
|
708
|
-
}[];
|
|
709
|
-
currentGrants: {
|
|
710
|
-
accessLevel: "admin" | "read" | "write";
|
|
711
|
-
containerId: string;
|
|
712
|
-
}[];
|
|
713
|
-
currentMemberEnvelopes: {
|
|
714
|
-
envelopes: {
|
|
715
|
-
kemCipherText: string;
|
|
716
|
-
memberKeyFingerprint: string;
|
|
717
|
-
userId: string;
|
|
718
|
-
wrappedKey: string;
|
|
719
|
-
}[];
|
|
720
|
-
epoch: number;
|
|
721
|
-
principalId: string;
|
|
722
|
-
principalType: "group" | "organization";
|
|
723
|
-
stateHash: string;
|
|
724
|
-
};
|
|
725
|
-
currentPayload: {
|
|
726
|
-
cipherSuite: "aes-256-gcm";
|
|
727
|
-
ciphertext: string;
|
|
728
|
-
ciphertextHash: string;
|
|
729
|
-
createdAt: string;
|
|
730
|
-
principalId: string;
|
|
731
|
-
principalType: "group" | "organization";
|
|
732
|
-
stateHash: string;
|
|
733
|
-
};
|
|
734
|
-
currentProjection: {
|
|
735
|
-
role: "member" | "admin";
|
|
736
|
-
userId: string;
|
|
737
|
-
}[];
|
|
738
|
-
currentState: {
|
|
739
|
-
createdAt: string;
|
|
740
|
-
encapsulationPublicKey: string;
|
|
741
|
-
externalAuthority: {
|
|
742
|
-
keyEpoch: number;
|
|
743
|
-
keyFingerprint: string;
|
|
744
|
-
principalId: string;
|
|
745
|
-
principalType: "group";
|
|
746
|
-
stateHash: string;
|
|
747
|
-
version: number;
|
|
748
|
-
} | null;
|
|
749
|
-
grantCount: number;
|
|
750
|
-
grantRoot: string;
|
|
751
|
-
keyEpoch: number;
|
|
752
|
-
keyFingerprint: string;
|
|
753
|
-
memberCount: number;
|
|
754
|
-
memberEnvelopesRoot: string;
|
|
755
|
-
membershipMode: "projection";
|
|
756
|
-
membershipRoot: string;
|
|
757
|
-
payloadCiphertextHash: string;
|
|
758
|
-
prevStateHash: string | null;
|
|
759
|
-
principalId: string;
|
|
760
|
-
principalType: "group" | "organization";
|
|
761
|
-
projectionRoot: string;
|
|
762
|
-
signature: string;
|
|
763
|
-
signedAt: string;
|
|
764
|
-
signerUserId: string;
|
|
765
|
-
signerUserKeyFingerprint: string;
|
|
766
|
-
stateHash: string;
|
|
767
|
-
version: number;
|
|
768
|
-
};
|
|
769
|
-
} & {
|
|
465
|
+
} | {
|
|
770
466
|
containerMutations: {
|
|
771
467
|
createdAt: string;
|
|
772
468
|
manifestHead: {
|
|
@@ -887,5 +583,5 @@ export declare function revokeOrganizationGrant(input: PrincipalMutationRuntime
|
|
|
887
583
|
stateHash: string;
|
|
888
584
|
version: number;
|
|
889
585
|
};
|
|
890
|
-
}
|
|
586
|
+
}>;
|
|
891
587
|
export {};
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { runWithSecurityIncidentReporting } from "../../data/keyingProjectionVerification/error.js";
|
|
2
2
|
import { addOrganizationGroupUser, createOrganizationGroup, deleteOrganizationGroup, removeOrganizationGroupUser, revokeOrganizationContainerGrant, rotateOrganizationGroupForAccessSetShrink, } from "../../workflows/organizations/index.js";
|
|
3
|
+
import { createCurrentOrganizationGroup } from "../../workflows/organizations/createCurrentOrganizationGroup.js";
|
|
4
|
+
import { createSelectedCurrentGroupMetadataContainerVerifier } from "../../workflows/organizations/currentGroupMetadataAuthority.js";
|
|
5
|
+
import { deleteCurrentOrganizationGroup } from "../../workflows/organizations/deleteCurrentOrganizationGroup.js";
|
|
3
6
|
import { createRuntimeGroupMetadataAccess } from "../../workflows/organizations/groupMetadataRuntime.js";
|
|
7
|
+
import { createRuntimeCurrentOrganizationMutation } from "../../workflows/organizations/runtimeCurrentOrganizationMutation.js";
|
|
4
8
|
import { createRuntimePrincipalPolicyWarmer } from "../../workflows/principals/runtimePolicyWarmer.js";
|
|
9
|
+
import { createCurrentPrincipalMutation } from "./currentPrincipalMutations.js";
|
|
5
10
|
import { syncOrganizationMetadataProfile } from "./organizationMetadataProfileSync.js";
|
|
6
11
|
import { preparePrincipalContainerMutations } from "./principalContainerMutations.js";
|
|
7
12
|
function requireSigningContext(runtime) {
|
|
@@ -33,30 +38,44 @@ export async function addUserToOrganizationGroup(input) {
|
|
|
33
38
|
organizationId: signingContext.organizationId,
|
|
34
39
|
}, async () => {
|
|
35
40
|
let memberGroupId = null;
|
|
36
|
-
const
|
|
37
|
-
apiClient: input.runtime.apiClient,
|
|
38
|
-
beforePolicyCommit: (_head, authority) => {
|
|
39
|
-
memberGroupId = authority.memberGroupId;
|
|
40
|
-
},
|
|
41
|
-
currentUserSecretKey: requireEncapsulationKeyPair(input.runtime)
|
|
42
|
-
.secretKey,
|
|
43
|
-
execSql: input.runtime.infra.execSql,
|
|
44
|
-
expectedGroupName: input.expectedGroupName,
|
|
45
|
-
readEncryptedName: createRuntimeGroupMetadataAccess(input.runtime, signingContext.organizationId, input.stillCurrent).readName,
|
|
46
|
-
groupId: input.groupId,
|
|
47
|
-
prepareContainerMutations: ({ currentPolicy, nextPolicy }) => preparePrincipalContainerMutations({
|
|
48
|
-
currentPolicy,
|
|
49
|
-
groupId: input.groupId,
|
|
50
|
-
nextPolicy,
|
|
51
|
-
organizationId: signingContext.organizationId,
|
|
52
|
-
runtime: input.runtime,
|
|
53
|
-
stillCurrent: input.stillCurrent,
|
|
54
|
-
}),
|
|
55
|
-
reportSecurityIncident: input.runtime.util.reportSecurityIncident,
|
|
56
|
-
resolveTrustedUserIdentity: input.runtime.resolveTrustedUserIdentity,
|
|
57
|
-
targetUserId: input.targetUserId,
|
|
41
|
+
const mutateCurrent = createCurrentPrincipalMutation({
|
|
58
42
|
...signingContext,
|
|
43
|
+
runtime: input.runtime,
|
|
44
|
+
stillCurrent: input.stillCurrent,
|
|
59
45
|
});
|
|
46
|
+
const current = mutateCurrent
|
|
47
|
+
? await mutateCurrent(input.groupId, {
|
|
48
|
+
kind: "add",
|
|
49
|
+
expectedGroupName: input.expectedGroupName,
|
|
50
|
+
targetUserId: input.targetUserId,
|
|
51
|
+
})
|
|
52
|
+
: undefined;
|
|
53
|
+
memberGroupId = current?.memberGroupId ?? null;
|
|
54
|
+
const bundle = current?.response ??
|
|
55
|
+
(await addOrganizationGroupUser({
|
|
56
|
+
apiClient: input.runtime.apiClient,
|
|
57
|
+
beforePolicyCommit: (_head, authority) => {
|
|
58
|
+
memberGroupId = authority.memberGroupId;
|
|
59
|
+
},
|
|
60
|
+
currentUserSecretKey: requireEncapsulationKeyPair(input.runtime)
|
|
61
|
+
.secretKey,
|
|
62
|
+
execSql: input.runtime.infra.execSql,
|
|
63
|
+
expectedGroupName: input.expectedGroupName,
|
|
64
|
+
readEncryptedName: createRuntimeGroupMetadataAccess(input.runtime, signingContext.organizationId, input.stillCurrent).readName,
|
|
65
|
+
groupId: input.groupId,
|
|
66
|
+
prepareContainerMutations: ({ currentPolicy, nextPolicy }) => preparePrincipalContainerMutations({
|
|
67
|
+
currentPolicy,
|
|
68
|
+
groupId: input.groupId,
|
|
69
|
+
nextPolicy,
|
|
70
|
+
organizationId: signingContext.organizationId,
|
|
71
|
+
runtime: input.runtime,
|
|
72
|
+
stillCurrent: input.stillCurrent,
|
|
73
|
+
}),
|
|
74
|
+
reportSecurityIncident: input.runtime.util.reportSecurityIncident,
|
|
75
|
+
resolveTrustedUserIdentity: input.runtime.resolveTrustedUserIdentity,
|
|
76
|
+
targetUserId: input.targetUserId,
|
|
77
|
+
...signingContext,
|
|
78
|
+
}));
|
|
60
79
|
if (input.groupId === memberGroupId) {
|
|
61
80
|
await syncOrganizationMetadataProfile({
|
|
62
81
|
containerContents: input.containerContents,
|
|
@@ -75,16 +94,37 @@ export function createGroupForOrganization(input) {
|
|
|
75
94
|
objectKind: "principal",
|
|
76
95
|
operation: "group.create",
|
|
77
96
|
organizationId: signingContext.organizationId,
|
|
78
|
-
}, () =>
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
97
|
+
}, () => {
|
|
98
|
+
const creatorEncapsulationKeyPair = requireEncapsulationKeyPair(input.runtime);
|
|
99
|
+
const mutate = createRuntimeCurrentOrganizationMutation(input.runtime);
|
|
100
|
+
if (mutate)
|
|
101
|
+
return mutate({ ...signingContext, stillCurrent: input.stillCurrent }, (context) => createCurrentOrganizationGroup({
|
|
102
|
+
...signingContext,
|
|
103
|
+
context,
|
|
104
|
+
apiClient: input.runtime.apiClient,
|
|
105
|
+
creatorEncapsulationKeyPair,
|
|
106
|
+
execSql: input.runtime.infra.execSql,
|
|
107
|
+
name: input.name,
|
|
108
|
+
metadataAccess: createRuntimeGroupMetadataAccess(input.runtime, signingContext.organizationId, context.stillCurrent, createSelectedCurrentGroupMetadataContainerVerifier({
|
|
109
|
+
authority: context,
|
|
110
|
+
organizationId: signingContext.organizationId,
|
|
111
|
+
stillCurrent: context.stillCurrent,
|
|
112
|
+
})),
|
|
113
|
+
reportSecurityIncident: input.runtime.util.reportSecurityIncident,
|
|
114
|
+
resolveTrustedUserIdentity: input.runtime.resolveTrustedUserIdentity,
|
|
115
|
+
}));
|
|
116
|
+
return createOrganizationGroup({
|
|
117
|
+
stillCurrent: input.stillCurrent,
|
|
118
|
+
apiClient: input.runtime.apiClient,
|
|
119
|
+
creatorEncapsulationKeyPair,
|
|
120
|
+
execSql: input.runtime.infra.execSql,
|
|
121
|
+
name: input.name,
|
|
122
|
+
metadataAccess: createRuntimeGroupMetadataAccess(input.runtime, signingContext.organizationId, input.stillCurrent),
|
|
123
|
+
reportSecurityIncident: input.runtime.util.reportSecurityIncident,
|
|
124
|
+
resolveTrustedUserIdentity: input.runtime.resolveTrustedUserIdentity,
|
|
125
|
+
...signingContext,
|
|
126
|
+
});
|
|
127
|
+
});
|
|
88
128
|
}
|
|
89
129
|
export function deleteGroupForOrganization(input) {
|
|
90
130
|
const signingContext = requireSigningContext(input.runtime);
|
|
@@ -93,13 +133,25 @@ export function deleteGroupForOrganization(input) {
|
|
|
93
133
|
objectKind: "principal",
|
|
94
134
|
operation: "group.delete",
|
|
95
135
|
organizationId: signingContext.organizationId,
|
|
96
|
-
}, () =>
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
136
|
+
}, () => {
|
|
137
|
+
const mutate = createRuntimeCurrentOrganizationMutation(input.runtime);
|
|
138
|
+
if (mutate)
|
|
139
|
+
return mutate({ ...signingContext, stillCurrent: input.stillCurrent }, (context) => deleteCurrentOrganizationGroup({
|
|
140
|
+
...signingContext,
|
|
141
|
+
context,
|
|
142
|
+
groupId: input.groupId,
|
|
143
|
+
apiClient: input.runtime.apiClient,
|
|
144
|
+
resolveTrustedUserIdentity: input.runtime.resolveTrustedUserIdentity,
|
|
145
|
+
}));
|
|
146
|
+
return deleteOrganizationGroup({
|
|
147
|
+
stillCurrent: input.stillCurrent,
|
|
148
|
+
apiClient: input.runtime.apiClient,
|
|
149
|
+
execSql: input.runtime.infra.execSql,
|
|
150
|
+
groupId: input.groupId,
|
|
151
|
+
resolveTrustedUserIdentity: input.runtime.resolveTrustedUserIdentity,
|
|
152
|
+
...signingContext,
|
|
153
|
+
});
|
|
154
|
+
});
|
|
103
155
|
}
|
|
104
156
|
export async function removeUserFromOrganizationGroup(input) {
|
|
105
157
|
const signingContext = requireSigningContext(input.runtime);
|
|
@@ -110,27 +162,41 @@ export async function removeUserFromOrganizationGroup(input) {
|
|
|
110
162
|
organizationId: signingContext.organizationId,
|
|
111
163
|
}, async () => {
|
|
112
164
|
let memberGroupId = null;
|
|
113
|
-
const
|
|
114
|
-
apiClient: input.runtime.apiClient,
|
|
115
|
-
beforePolicyCommit: (_head, authority) => {
|
|
116
|
-
memberGroupId = authority.memberGroupId;
|
|
117
|
-
},
|
|
118
|
-
execSql: input.runtime.infra.execSql,
|
|
119
|
-
expectedGroupName: input.expectedGroupName,
|
|
120
|
-
readEncryptedName: createRuntimeGroupMetadataAccess(input.runtime, signingContext.organizationId, input.stillCurrent).readName,
|
|
121
|
-
groupId: input.groupId,
|
|
122
|
-
prepareContainerMutations: ({ currentPolicy, nextPolicy }) => preparePrincipalContainerMutations({
|
|
123
|
-
currentPolicy,
|
|
124
|
-
groupId: input.groupId,
|
|
125
|
-
nextPolicy,
|
|
126
|
-
organizationId: signingContext.organizationId,
|
|
127
|
-
runtime: input.runtime,
|
|
128
|
-
stillCurrent: input.stillCurrent,
|
|
129
|
-
}),
|
|
130
|
-
removedUserId: input.removedUserId,
|
|
131
|
-
resolveTrustedUserIdentity: input.runtime.resolveTrustedUserIdentity,
|
|
165
|
+
const mutateCurrent = createCurrentPrincipalMutation({
|
|
132
166
|
...signingContext,
|
|
167
|
+
runtime: input.runtime,
|
|
168
|
+
stillCurrent: input.stillCurrent,
|
|
133
169
|
});
|
|
170
|
+
const current = mutateCurrent
|
|
171
|
+
? await mutateCurrent(input.groupId, {
|
|
172
|
+
kind: "remove",
|
|
173
|
+
expectedGroupName: input.expectedGroupName,
|
|
174
|
+
removedUserId: input.removedUserId,
|
|
175
|
+
})
|
|
176
|
+
: undefined;
|
|
177
|
+
memberGroupId = current?.memberGroupId ?? null;
|
|
178
|
+
const bundle = current?.response ??
|
|
179
|
+
(await removeOrganizationGroupUser({
|
|
180
|
+
apiClient: input.runtime.apiClient,
|
|
181
|
+
beforePolicyCommit: (_head, authority) => {
|
|
182
|
+
memberGroupId = authority.memberGroupId;
|
|
183
|
+
},
|
|
184
|
+
execSql: input.runtime.infra.execSql,
|
|
185
|
+
expectedGroupName: input.expectedGroupName,
|
|
186
|
+
readEncryptedName: createRuntimeGroupMetadataAccess(input.runtime, signingContext.organizationId, input.stillCurrent).readName,
|
|
187
|
+
groupId: input.groupId,
|
|
188
|
+
prepareContainerMutations: ({ currentPolicy, nextPolicy }) => preparePrincipalContainerMutations({
|
|
189
|
+
currentPolicy,
|
|
190
|
+
groupId: input.groupId,
|
|
191
|
+
nextPolicy,
|
|
192
|
+
organizationId: signingContext.organizationId,
|
|
193
|
+
runtime: input.runtime,
|
|
194
|
+
stillCurrent: input.stillCurrent,
|
|
195
|
+
}),
|
|
196
|
+
removedUserId: input.removedUserId,
|
|
197
|
+
resolveTrustedUserIdentity: input.runtime.resolveTrustedUserIdentity,
|
|
198
|
+
...signingContext,
|
|
199
|
+
}));
|
|
134
200
|
if (input.groupId === memberGroupId) {
|
|
135
201
|
await syncOrganizationMetadataProfile({
|
|
136
202
|
containerContents: input.containerContents,
|
|
@@ -154,39 +220,51 @@ export async function revokeOrganizationGrant(input) {
|
|
|
154
220
|
operation: "principal.grant.revoke",
|
|
155
221
|
organizationId: signingContext.organizationId,
|
|
156
222
|
}, async () => {
|
|
157
|
-
const
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
223
|
+
const mutateCurrent = createCurrentPrincipalMutation({
|
|
224
|
+
...signingContext,
|
|
225
|
+
runtime: input.runtime,
|
|
226
|
+
stillCurrent: input.stillCurrent,
|
|
227
|
+
});
|
|
228
|
+
const current = input.subjectType === "group" && mutateCurrent
|
|
229
|
+
? await mutateCurrent(input.subjectId, {
|
|
230
|
+
kind: "revoke",
|
|
162
231
|
revokedContainerId: input.containerId,
|
|
163
|
-
|
|
164
|
-
|
|
232
|
+
})
|
|
233
|
+
: undefined;
|
|
234
|
+
const response = current?.response ??
|
|
235
|
+
(input.subjectType === "group"
|
|
236
|
+
? await rotateOrganizationGroupForAccessSetShrink({
|
|
237
|
+
apiClient: input.runtime.apiClient,
|
|
238
|
+
execSql: input.runtime.infra.execSql,
|
|
165
239
|
groupId: input.subjectId,
|
|
166
|
-
nextPolicy,
|
|
167
|
-
organizationId: signingContext.organizationId,
|
|
168
240
|
revokedContainerId: input.containerId,
|
|
169
|
-
|
|
241
|
+
prepareContainerMutations: ({ currentPolicy, nextPolicy }) => preparePrincipalContainerMutations({
|
|
242
|
+
currentPolicy,
|
|
243
|
+
groupId: input.subjectId,
|
|
244
|
+
nextPolicy,
|
|
245
|
+
organizationId: signingContext.organizationId,
|
|
246
|
+
revokedContainerId: input.containerId,
|
|
247
|
+
runtime: input.runtime,
|
|
248
|
+
stillCurrent: input.stillCurrent,
|
|
249
|
+
}),
|
|
250
|
+
resolveTrustedUserIdentity: input.runtime.resolveTrustedUserIdentity,
|
|
251
|
+
...signingContext,
|
|
252
|
+
})
|
|
253
|
+
: await revokeOrganizationContainerGrant({
|
|
170
254
|
stillCurrent: input.stillCurrent,
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
subjectType: input.subjectType,
|
|
185
|
-
},
|
|
186
|
-
resolveTrustedUserIdentity: input.runtime.resolveTrustedUserIdentity,
|
|
187
|
-
warmReferencedPrincipalPolicies: createRuntimePrincipalPolicyWarmer(input.runtime),
|
|
188
|
-
...signingContext,
|
|
189
|
-
});
|
|
255
|
+
reportSecurityIncident: input.runtime.util.reportSecurityIncident,
|
|
256
|
+
apiClient: input.runtime.apiClient,
|
|
257
|
+
containerId: input.containerId,
|
|
258
|
+
encapsulationKeyPair,
|
|
259
|
+
execSql: input.runtime.infra.execSql,
|
|
260
|
+
revokedSubject: {
|
|
261
|
+
subjectId: input.subjectId,
|
|
262
|
+
subjectType: input.subjectType,
|
|
263
|
+
},
|
|
264
|
+
resolveTrustedUserIdentity: input.runtime.resolveTrustedUserIdentity,
|
|
265
|
+
warmReferencedPrincipalPolicies: createRuntimePrincipalPolicyWarmer(input.runtime),
|
|
266
|
+
...signingContext,
|
|
267
|
+
}));
|
|
190
268
|
await input.readModelCoordinator.reconcileAfterMutation(signingContext.organizationId);
|
|
191
269
|
return response;
|
|
192
270
|
});
|