-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(package): move from javascript to typescript
EME-5329 BREAKING CHANGE: Typescript implementation Co-authored-by: Gabor Nemeth <gabor.nemeth@emarsys.com>
- Loading branch information
Showing
17 changed files
with
467 additions
and
288 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
"mocha": true, | ||
"es6": true | ||
}, | ||
"parser": "babel-eslint", | ||
"globals": { | ||
"expect": true | ||
}, | ||
|
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 |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
logs | ||
*.log | ||
.nyc_output | ||
dist | ||
|
||
# Runtime data | ||
pids | ||
|
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
declare module 'escher-auth' { | ||
export type KeyDB = (key: string) => string; | ||
|
||
export type EscherRequest = { | ||
method: string; | ||
host: string; | ||
port: number; | ||
url: string; | ||
body?: string | Buffer; | ||
headers?: string[][]; // [["Date","Fri, 09 Sep 2011 23:36:00 GMT"],["Host","host.foo.com"] | ||
}; | ||
|
||
export type Config = { | ||
algoPrefix?: string; | ||
vendorKey?: string; | ||
hashAlgo?: 'SHA256' | 'SHA512'; | ||
credentialScope?: string; | ||
accessKeyId?: string; | ||
apiSecret?: string; | ||
authHeaderName?: string; | ||
dateHeaderName?: string; | ||
clockSkew?: number; | ||
} & Record<string, unknown>; | ||
|
||
export default class Escher { | ||
constructor(configToMerge?: Config); | ||
static create(configToMerge?: Config): Escher; | ||
public preSignUrl(url: string, expirationInSec: number): string; | ||
public signRequest(requestOptions: ExtendedRequestOption, body?: string | Buffer, headersToSign?: string[]): EscherRequest; | ||
public authenticate(request: EscherRequest, keyDb: KeyDB, mandatorySignedHeaders?: string[]): string; | ||
public validateRequest(request: EscherRequest, body?: string | Buffer): void; | ||
public validateMandatorySignedHeaders(mandatorySignedHeaders?: string[]): void; | ||
} | ||
} |
Oops, something went wrong.