mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 03:57:32 +00:00
feat: add quotas (#4779)
adds possibilities to cap authenticated requests and execution seconds of actions on a defined intervall
This commit is contained in:
@@ -1,18 +1,14 @@
|
||||
import { Context } from 'support/commands';
|
||||
import { ensureItemExists } from './ensure';
|
||||
import { getOrgUnderTest } from './orgs';
|
||||
import { API } from './types';
|
||||
|
||||
export function ensureProjectGrantExists(
|
||||
api: API,
|
||||
foreignOrgId: number,
|
||||
foreignProjectId: number,
|
||||
): Cypress.Chainable<number> {
|
||||
return getOrgUnderTest(api).then((orgUnderTest) => {
|
||||
export function ensureProjectGrantExists(ctx: Context, foreignOrgId: string, foreignProjectId: string) {
|
||||
return getOrgUnderTest(ctx).then((orgUnderTest) => {
|
||||
return ensureItemExists(
|
||||
api,
|
||||
`${api.mgmtBaseURL}/projectgrants/_search`,
|
||||
ctx.api,
|
||||
`${ctx.api.mgmtBaseURL}/projectgrants/_search`,
|
||||
(grant: any) => grant.grantedOrgId == orgUnderTest && grant.projectId == foreignProjectId,
|
||||
`${api.mgmtBaseURL}/projects/${foreignProjectId}/grants`,
|
||||
`${ctx.api.mgmtBaseURL}/projects/${foreignProjectId}/grants`,
|
||||
{ granted_org_id: orgUnderTest },
|
||||
foreignOrgId,
|
||||
'grantId',
|
||||
|
Reference in New Issue
Block a user