@camunda/e2e-test-suite 0.0.1657 → 0.0.1658

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.
@@ -33,15 +33,23 @@ api_1.test.describe('Cluster and authentication', () => {
33
33
  (0, test_1.expect)(me.username, 'a user principal is identified by name').toBeTruthy();
34
34
  }
35
35
  });
36
- // Not gated on `unauthenticatedAccessAllowed`: /v2/authentication/me
37
- // refuses an anonymous caller even where the rest of the tree does not,
38
- // so this one holds on an open cluster too and passed on c8Run.
36
+ // A protected cluster refuses an anonymous caller of /v2/authentication/me.
37
+ // An unprotected one (c8Run's default) answers it with the anonymous
38
+ // principal from 8.10.10 on — camunda/camunda#66964, backported to
39
+ // stable/8.10 in #68796 — so there the test asserts that contract instead.
39
40
  (0, api_1.test)('rejects an unauthenticated principal lookup', async ({ api }) => {
40
41
  const response = await api.get('/authentication/me', {
41
42
  tenant: 'none',
42
43
  authorization: null,
43
44
  });
44
- await (0, assertions_1.assertUnauthorized)(response);
45
+ if (capabilities_1.unauthenticatedAccessAllowed === false || !(0, config_1.atLeastRelease)('8.10.10')) {
46
+ await (0, assertions_1.assertUnauthorized)(response);
47
+ return;
48
+ }
49
+ const me = (await (0, assertions_1.assertOk)(response));
50
+ (0, test_1.expect)(me.isAnonymous, 'the caller is reported as anonymous').toBe(true);
51
+ (0, test_1.expect)(me.username, 'an anonymous caller has no username').toBeNull();
52
+ (0, test_1.expect)(me.authorizedComponents).toEqual(['*']);
45
53
  });
46
54
  (0, api_1.test)('reports cluster topology with at least one broker', async ({ api }) => {
47
55
  const response = await api.get('/topology', { tenant: 'none' });
@@ -27,6 +27,11 @@ export interface ApiConfig {
27
27
  tenantId: string;
28
28
  /** Minor version under test, e.g. `8.8`. Gates version-specific expectations. */
29
29
  zeebeVersion: string;
30
+ /**
31
+ * Full product version under test, e.g. `8.10.10-SNAPSHOT`, or empty when
32
+ * unknown. Gates behavior that changed in a patch release.
33
+ */
34
+ camundaVersion: string;
30
35
  /**
31
36
  * Whether the cluster serves `/v2/users/**` at all.
32
37
  *
@@ -121,3 +126,9 @@ export declare const apiConfig: ApiConfig;
121
126
  * Used to gate expectations for endpoints that only exist from a given release.
122
127
  */
123
128
  export declare function atLeastVersion(minor: string): boolean;
129
+ /**
130
+ * True when the cluster runs at or above `release`, e.g.
131
+ * `atLeastRelease('8.10.10')`. A `-SNAPSHOT` or pre-release suffix compares
132
+ * as its base version. Without `CAMUNDA_VERSION` it falls back to the minor.
133
+ */
134
+ export declare function atLeastRelease(release: string): boolean;
@@ -6,7 +6,7 @@
6
6
  * consumed, so the CI workflows that export them keep working unchanged.
7
7
  */
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.atLeastVersion = exports.apiConfig = exports.loadApiConfig = void 0;
9
+ exports.atLeastRelease = exports.atLeastVersion = exports.apiConfig = exports.loadApiConfig = void 0;
10
10
  function env(name, fallback = '') {
11
11
  const value = process.env[name];
12
12
  return value === undefined || value === '' ? fallback : value;
@@ -32,6 +32,7 @@ function loadApiConfig() {
32
32
  multiTenancy: env('MT', 'true') === 'true',
33
33
  tenantId: env('TENANT_ID', '<default>'),
34
34
  zeebeVersion: env('ZEEBE_VERSION', '8.8'),
35
+ camundaVersion: env('CAMUNDA_VERSION', ''),
35
36
  // The SM Helm flows this suite runs in deploy Keycloak and drive the API
36
37
  // with client credentials, so `oauth2` means the cluster is in OIDC mode.
37
38
  // `USERS_API_ENABLED` overrides that for a deployment where the two come
@@ -70,3 +71,28 @@ function atLeastVersion(minor) {
70
71
  return major > reqMajor || (major === reqMajor && minorPart >= reqMinor);
71
72
  }
72
73
  exports.atLeastVersion = atLeastVersion;
74
+ /**
75
+ * True when the cluster runs at or above `release`, e.g.
76
+ * `atLeastRelease('8.10.10')`. A `-SNAPSHOT` or pre-release suffix compares
77
+ * as its base version. Without `CAMUNDA_VERSION` it falls back to the minor.
78
+ */
79
+ function atLeastRelease(release) {
80
+ const parse = (v) => v
81
+ .split('-')[0]
82
+ .split('.')
83
+ .map((part) => parseInt(part, 10));
84
+ if (!exports.apiConfig.camundaVersion) {
85
+ return atLeastVersion(release.split('.').slice(0, 2).join('.'));
86
+ }
87
+ const actual = parse(exports.apiConfig.camundaVersion);
88
+ const required = parse(release);
89
+ if (actual.some(Number.isNaN))
90
+ return true;
91
+ for (let i = 0; i < required.length; i++) {
92
+ const a = actual[i] ?? 0;
93
+ if (a !== required[i])
94
+ return a > required[i];
95
+ }
96
+ return true;
97
+ }
98
+ exports.atLeastRelease = atLeastRelease;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/e2e-test-suite",
3
- "version": "0.0.1657",
3
+ "version": "0.0.1658",
4
4
  "description": "End-to-end test helpers for Camunda 8",
5
5
  "repository": {
6
6
  "type": "git",