Skip to content

Commit

Permalink
Code review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
malcyL committed Sep 21, 2023
1 parent b1e786d commit beb5cc9
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 4 deletions.
3 changes: 0 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@ module.exports = {
root: true,
parser: "@typescript-eslint/parser",
plugins: ["@typescript-eslint"],
rules: {
"@typescript-eslint/no-explicit-any": "off",
},
env: {
node: true,
},
Expand Down
2 changes: 2 additions & 0 deletions lib/aspects/resource_prefixer/resource_prefixer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@ import {
import { CfnResourcePrefixer } from "./cfn_resource_prefixer";
import { EmptyCfnResourcePrefixer } from "./prefixers/empty_cfn_resource_prefixer";

/* eslint-disable @typescript-eslint/no-explicit-any */
export type Constructor<T> = { new (...args: any[]): T };

type CfnResourceConstructor = {
new (...args: any[]): cdk.CfnResource;
CFN_RESOURCE_TYPE_NAME: string;
};
/* eslint-enable @typescript-eslint/no-explicit-any */

export class ResourcePrefixer implements cdk.IAspect {
private prefix: string;
Expand Down
2 changes: 2 additions & 0 deletions src/lambda/api/PersonaAuthorizer.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import { PersonaClient } from "talis-node";
type ParsedArn = {
method: string;
Expand Down Expand Up @@ -44,3 +45,4 @@ export declare class PersonaAuthorizer {
pathMatch(pathDefinition: string, path: string): boolean;
}
export {};
/* eslint-enable @typescript-eslint/no-explicit-any */
4 changes: 3 additions & 1 deletion src/lambda/api/PersonaAuthorizer.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions src/lambda/api/PersonaAuthorizer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ const API_GATEWAY_ARN_INDEXES = [
RESOURCE_PATH_INDEX,
];

/* eslint-disable @typescript-eslint/no-explicit-any */
export class PersonaAuthorizer {
event: any;
context: any;
Expand Down Expand Up @@ -270,3 +271,4 @@ export class PersonaAuthorizer {
return true;
}
}
/* eslint-enable @typescript-eslint/no-explicit-any */
2 changes: 2 additions & 0 deletions src/lambda/api/authorizer.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { PersonaAuthorizer } from "./PersonaAuthorizer";

/* eslint-disable @typescript-eslint/no-explicit-any */
module.exports.validateToken = async (event: any, context: any) => {
const route = new PersonaAuthorizer(event, context);
return await route.handle();
};
/* eslint-enable @typescript-eslint/no-explicit-any */
2 changes: 2 additions & 0 deletions src/types/talis-node/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
declare module "talis-node" {
type ERROR_TYPES = {
VALIDATION_FAILURE: "validation_failure";
Expand All @@ -22,3 +23,4 @@ declare module "talis-node" {
export const persona: persona;
export const PersonaClient: PersonaClient;
}
/* eslint-enable @typescript-eslint/no-explicit-any */

0 comments on commit beb5cc9

Please sign in to comment.