mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-15 12:27:59 +00:00
681541f41b
adds possibilities to cap authenticated requests and execution seconds of actions on a defined intervall
19 lines
664 B
TypeScript
19 lines
664 B
TypeScript
import { Context } from 'support/commands';
|
|
import { ensureItemExists } from './ensure';
|
|
import { getOrgUnderTest } from './orgs';
|
|
|
|
export function ensureProjectGrantExists(ctx: Context, foreignOrgId: string, foreignProjectId: string) {
|
|
return getOrgUnderTest(ctx).then((orgUnderTest) => {
|
|
return ensureItemExists(
|
|
ctx.api,
|
|
`${ctx.api.mgmtBaseURL}/projectgrants/_search`,
|
|
(grant: any) => grant.grantedOrgId == orgUnderTest && grant.projectId == foreignProjectId,
|
|
`${ctx.api.mgmtBaseURL}/projects/${foreignProjectId}/grants`,
|
|
{ granted_org_id: orgUnderTest },
|
|
foreignOrgId,
|
|
'grantId',
|
|
'grantId',
|
|
);
|
|
});
|
|
}
|