Skip to content

Commit aa30636

Browse files
committed
Changed tests formatting.
1 parent 65200e0 commit aa30636

File tree

2 files changed

+99
-0
lines changed

2 files changed

+99
-0
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
// Copyright 2025 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
'use strict';
16+
17+
const assert = require('assert');
18+
const {
19+
authenticateWithAwsCredentials,
20+
} = require('../customCredentialSupplierAws');
21+
22+
describe('Custom Credential Supplier AWS', () => {
23+
const audience = process.env.GCP_WORKLOAD_AUDIENCE;
24+
const bucketName = process.env.GCS_BUCKET_NAME;
25+
const impersonationUrl = process.env.GCP_SERVICE_ACCOUNT_IMPERSONATION_URL;
26+
27+
it('should authenticate using AWS credentials', async function () {
28+
// Skip system tests if required environment variables are missing
29+
if (
30+
!process.env.AWS_ACCESS_KEY_ID ||
31+
!process.env.AWS_SECRET_ACCESS_KEY ||
32+
!process.env.AWS_REGION ||
33+
!audience ||
34+
!bucketName
35+
) {
36+
this.skip();
37+
}
38+
39+
const metadata = await authenticateWithAwsCredentials(
40+
bucketName,
41+
audience,
42+
impersonationUrl
43+
);
44+
45+
assert.strictEqual(metadata.name, bucketName);
46+
assert.ok(metadata.location);
47+
});
48+
});
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
// Copyright 2025 Google LLC
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
'use strict';
16+
17+
const assert = require('assert');
18+
const {
19+
authenticateWithOktaCredentials,
20+
} = require('../customCredentialSupplierOkta');
21+
22+
describe('Custom Credential Supplier Okta', () => {
23+
const audience = process.env.GCP_WORKLOAD_AUDIENCE;
24+
const bucketName = process.env.GCS_BUCKET_NAME;
25+
const impersonationUrl = process.env.GCP_SERVICE_ACCOUNT_IMPERSONATION_URL;
26+
27+
it('should authenticate using Okta credentials', async function () {
28+
// Skip system tests if required environment variables are missing
29+
if (
30+
!process.env.OKTA_DOMAIN ||
31+
!process.env.OKTA_CLIENT_ID ||
32+
!process.env.OKTA_CLIENT_SECRET ||
33+
!audience ||
34+
!bucketName
35+
) {
36+
this.skip();
37+
}
38+
39+
const metadata = await authenticateWithOktaCredentials(
40+
bucketName,
41+
audience,
42+
process.env.OKTA_DOMAIN,
43+
process.env.OKTA_CLIENT_ID,
44+
process.env.OKTA_CLIENT_SECRET,
45+
impersonationUrl
46+
);
47+
48+
assert.strictEqual(metadata.name, bucketName);
49+
assert.ok(metadata.location);
50+
});
51+
});

0 commit comments

Comments
 (0)