-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: replace safe browsing with web risk
- Loading branch information
Showing
7 changed files
with
191 additions
and
211 deletions.
There are no files selected for viewing
10 changes: 5 additions & 5 deletions
10
src/server/modules/threat/interfaces/SafeBrowsingRepository.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,17 @@ | ||
import { HasCacheDuration } from '../../../repositories/types' | ||
import { WebRiskThreat } from '../../../repositories/types' | ||
|
||
export interface SafeBrowsingRepository { | ||
/** | ||
* Sets or replaces the Safe Browsing threat matches associated with a URL. | ||
* @param {string} url The URL. | ||
* @param {Array<HasCacheDuration>} matches The threat matches returned by Safe Browsing for the URL. | ||
* @param {WebRiskThreat} threat The threat match returned by Safe Browsing for the URL. | ||
*/ | ||
set(url: string, matches: HasCacheDuration[]): Promise<void> | ||
set(url: string, threat: WebRiskThreat): Promise<void> | ||
|
||
/** | ||
* Retrieves Safe Browsing threat matches for a URL, if any. | ||
* @param {string} url The URL. | ||
* @returns {Promise<Array<HasCacheDuration> | null>} An array of threat matches, or null if none. | ||
* @returns {Promise<WebRiskThreat | null>} Threat match or null if none. | ||
*/ | ||
get(url: string): Promise<HasCacheDuration[] | null> | ||
get(url: string): Promise<WebRiskThreat | null> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.