Skip to content

Commit c4e4092

Browse files
committed
Fix linting errors: rename xaa-util to xaaUtil, fix unicorn rules
1 parent 2d7d9a2 commit c4e4092

5 files changed

Lines changed: 611 additions & 11 deletions

File tree

packages/client/src/client/middleware.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ import type { FetchLike } from '@modelcontextprotocol/core';
22

33
import type { OAuthClientProvider } from './auth.js';
44
import { auth, extractWWWAuthenticateParams, UnauthorizedError } from './auth.js';
5-
import type { XAAOptions } from './xaa-util.js';
6-
import { getAccessToken } from './xaa-util.js';
5+
import type { XAAOptions } from './xaaUtil.js';
6+
import { getAccessToken } from './xaaUtil.js';
77

88
/**
99
* Middleware function that wraps and enhances fetch functionality.
@@ -243,7 +243,7 @@ export const withLogging = (options: LoggingOptions = {}): Middleware => {
243243
*/
244244
export const withCrossAppAccess = (options: XAAOptions): Middleware => {
245245
return wrappedFetchFunction => {
246-
let accessToken: string | undefined = undefined;
246+
let accessToken: string | undefined;
247247

248248
return async (url, init = {}): Promise<Response> => {
249249
if (!accessToken) {

packages/client/src/client/xaa-util.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ const transformScopes = (scopes?: string | Set<string> | string[] | null) => {
179179
}
180180

181181
if (scopes instanceof Set) {
182-
return Array.from(scopes).join(' ');
182+
return [...scopes].join(' ');
183183
}
184184

185185
if (typeof scopes === 'string') {
@@ -221,14 +221,17 @@ const requestIdJwtAuthzGrant = async (
221221
let subjectTokenUrn: OAuthTokenType;
222222

223223
switch (subjectTokenType) {
224-
case 'saml':
224+
case 'saml': {
225225
subjectTokenUrn = OAuthTokenType.SAML2;
226226
break;
227-
case 'oidc':
227+
}
228+
case 'oidc': {
228229
subjectTokenUrn = OAuthTokenType.ID_TOKEN;
229230
break;
230-
default:
231+
}
232+
default: {
231233
throw new InvalidArgumentError('opts.subjectTokenType', 'A valid SubjectTokenType constant is required.');
234+
}
232235
}
233236

234237
const scope = transformScopes(scopes);

0 commit comments

Comments
 (0)