Skip to content

Commit

Permalink
feat: add default action for filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
anxolin committed Nov 22, 2023
1 parent 8db279e commit 1a049a2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/utils/filterPolicy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export enum FilterAction {
}

interface PolicyConfig {
defaultAction: FilterAction;
owners: Map<string, FilterAction>;
handlers: Map<string, FilterAction>;
}
Expand Down Expand Up @@ -48,7 +49,7 @@ export class FilterPolicy {
return action;
}

return FilterAction.ACCEPT;
return this.config.defaultAction;
}

/**
Expand Down Expand Up @@ -77,6 +78,7 @@ export class FilterPolicy {
}
const config = await configResponse.json();
return {
defaultAction: config.defaultAction,
owners: new Map(Object.entries(config.owners)),
handlers: new Map(Object.entries(config.handlers)),
};
Expand Down

0 comments on commit 1a049a2

Please sign in to comment.