Skip to content

Commit 5ec4657

Browse files
author
cloud-sdk-js
committed
Changes from lint:fix
1 parent 0ed94aa commit 5ec4657

File tree

4 files changed

+21
-24
lines changed

4 files changed

+21
-24
lines changed

packages/connectivity/src/scp-cf/destination/service-binding-to-destination.spec.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ const services = {
2828
credentials: {
2929
url: 'https://tenant.accounts.ondemand.com',
3030
clientid: 'identity-clientid',
31-
certificate: '-----BEGIN CERTIFICATE-----\ntest\n-----END CERTIFICATE-----',
31+
certificate:
32+
'-----BEGIN CERTIFICATE-----\ntest\n-----END CERTIFICATE-----',
3233
key: '-----BEGIN RSA PRIVATE KEY-----\ntest\n-----END RSA PRIVATE KEY-----'
3334
}
3435
}
@@ -310,7 +311,9 @@ describe('service binding to destination', () => {
310311
it('transforms identity (IAS) service binding with resource parameter', async () => {
311312
const destination = await transformServiceBindingToDestination(
312313
resolveServiceBinding('identity'),
313-
{ resource: 'my-app' } as Parameters<typeof transformServiceBindingToDestination>[1]
314+
{ resource: 'my-app' } as Parameters<
315+
typeof transformServiceBindingToDestination
316+
>[1]
314317
);
315318
expect(destination).toEqual(
316319
expect.objectContaining({

packages/connectivity/src/scp-cf/identity-service.spec.ts

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ describe('getIasClientCredentialsToken', () => {
5454
credentials: {
5555
url: 'https://tenant.accounts.ondemand.com',
5656
clientid: 'test-client-id',
57-
certificate: '-----BEGIN CERTIFICATE-----\ntest-cert\n-----END CERTIFICATE-----',
57+
certificate:
58+
'-----BEGIN CERTIFICATE-----\ntest-cert\n-----END CERTIFICATE-----',
5859
key: '-----BEGIN RSA PRIVATE KEY-----\ntest-key\n-----END RSA PRIVATE KEY-----'
5960
}
6061
};
@@ -193,9 +194,9 @@ describe('getIasClientCredentialsToken', () => {
193194
} as any
194195
};
195196

196-
await expect(
197-
getIasClientCredentialsToken(invalidService)
198-
).rejects.toThrow('IAS credentials must contain "url" and "clientid"');
197+
await expect(getIasClientCredentialsToken(invalidService)).rejects.toThrow(
198+
'IAS credentials must contain "url" and "clientid"'
199+
);
199200
});
200201

201202
it('throws error when clientid is missing', async () => {
@@ -208,9 +209,9 @@ describe('getIasClientCredentialsToken', () => {
208209
} as any
209210
};
210211

211-
await expect(
212-
getIasClientCredentialsToken(invalidService)
213-
).rejects.toThrow('IAS credentials must contain "url" and "clientid"');
212+
await expect(getIasClientCredentialsToken(invalidService)).rejects.toThrow(
213+
'IAS credentials must contain "url" and "clientid"'
214+
);
214215
});
215216

216217
it('throws error when neither certificate/key nor clientsecret is provided', async () => {
@@ -222,19 +223,15 @@ describe('getIasClientCredentialsToken', () => {
222223
} as any
223224
};
224225

225-
await expect(
226-
getIasClientCredentialsToken(invalidService)
227-
).rejects.toThrow(
226+
await expect(getIasClientCredentialsToken(invalidService)).rejects.toThrow(
228227
'IAS credentials must contain either "certificate" and "key" for mTLS, or "clientsecret" for client secret authentication'
229228
);
230229
});
231230

232231
it('handles token fetch errors gracefully', async () => {
233232
mockedAxios.request.mockRejectedValue(new Error('Network error'));
234233

235-
await expect(
236-
getIasClientCredentialsToken(mockIasService)
237-
).rejects.toThrow(
234+
await expect(getIasClientCredentialsToken(mockIasService)).rejects.toThrow(
238235
'Could not fetch IAS client credentials token for service of type identity'
239236
);
240237
});

packages/connectivity/src/scp-cf/identity-service.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,9 @@ export async function getIasClientCredentialsToken(
9696
);
9797
}
9898

99-
for (const [paramKey, paramValue] of Object.entries(arg.extraParams || {})) {
99+
for (const [paramKey, paramValue] of Object.entries(
100+
arg.extraParams || {}
101+
)) {
100102
params.append(paramKey, paramValue);
101103
}
102104

@@ -133,7 +135,8 @@ export async function getIasClientCredentialsToken(
133135
);
134136
}
135137

136-
const response = await axios.request<ClientCredentialsResponse>(requestConfig);
138+
const response =
139+
await axios.request<ClientCredentialsResponse>(requestConfig);
137140
return response.data;
138141
};
139142

packages/connectivity/src/scp-cf/jwt/jwt.spec.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,7 @@ import {
44
mockServiceBindings,
55
signedJwtForVerification
66
} from '../../../../../test-resources/test/test-util';
7-
import {
8-
audiences,
9-
decodeJwt,
10-
isXsuaaToken,
11-
retrieveJwt,
12-
userId
13-
} from './jwt';
7+
import { audiences, decodeJwt, isXsuaaToken, retrieveJwt, userId } from './jwt';
148

159
describe('jwt', () => {
1610
describe('userId', () => {

0 commit comments

Comments
 (0)