-
Notifications
You must be signed in to change notification settings - Fork 221
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(auth): introduce WithinBody option for AuthMode
fixes #1035 Implementation is done by: - adding a new auth mode - adding data as the return type for createAuth - expose data from transporter - serialize transporter data - map api key back to query parameter if GET
- Loading branch information
Showing
13 changed files
with
61 additions
and
17 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
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 |
---|---|---|
@@ -1,13 +1,17 @@ | ||
export type Auth = { | ||
/** | ||
* Returns the headers related to auth. Should be | ||
* merged to the transporter headers. | ||
* Returns the headers related to auth. Should be merged into the headers. | ||
*/ | ||
readonly headers: () => Readonly<Record<string, string>>; | ||
|
||
/** | ||
* Returns the query parameters related to auth. Should be | ||
* merged to the query parameters headers. | ||
* Returns the query parameters related to auth. Should be merged into the | ||
* query parameters. | ||
*/ | ||
readonly queryParameters: () => Readonly<Record<string, string>>; | ||
|
||
/** | ||
* Returns the data related to auth. Should be merged into the body. | ||
*/ | ||
readonly data: () => Readonly<Record<string, string>>; | ||
}; |
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,13 +1,18 @@ | ||
export const AuthMode: Readonly<Record<string, AuthModeType>> = { | ||
/** | ||
* If auth credentials should be in query parameters. | ||
* Algolia credentials are sent as query parameters | ||
*/ | ||
WithinQueryParameters: 0, | ||
|
||
/** | ||
* If auth credentials should be in headers. | ||
* Algolia credentials are sent as headers | ||
*/ | ||
WithinHeaders: 1, | ||
|
||
/** | ||
* Algolia credentials are sent as part of the body | ||
*/ | ||
WithinBody: 2, | ||
}; | ||
|
||
export type AuthModeType = 0 | 1; | ||
export type AuthModeType = 0 | 1 | 2; |
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
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
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