-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
EventsSDK: Revise Authorization in AnalyticsConfig (#124)
Previously we had to fields in AnalyticsConfig that we're optional, `key` and `bearer`, where we throw an error if none or both are set. This change updates the interface so it is more clear that only one is required. There is now `authorizationType` which is either a string `apiKey` or `Bearer` and `authorization` which is the token itself. We need `authorizationType` so we can append the proper prefix of `KEY ` or `Bearer ` to the final authorization property to avoid passing this work onto the user. This also updates necessary test files to reflect this change, and removes logic for ensuring that only one of key or bearer is set. [J=FUS-6201](https://yexttest.atlassian.net/browse/FUS-6201) R=abenno, mtian, mkilpatrick TEST=auto --------- Co-authored-by: Ethan Jaffee <[email protected]> Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
- Loading branch information
1 parent
98a8795
commit e5bd3d6
Showing
12 changed files
with
110 additions
and
74 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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@yext/analytics](./analytics.md) > [AnalyticsConfig](./analytics.analyticsconfig.md) > [authorization](./analytics.analyticsconfig.authorization.md) | ||
|
||
## AnalyticsConfig.authorization property | ||
|
||
The API Key, OAuth, or bearer token for accessing the Analytics Events API. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
authorization: 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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<!-- Do not edit this file. It is automatically generated by API Documenter. --> | ||
|
||
[Home](./index.md) > [@yext/analytics](./analytics.md) > [AnalyticsConfig](./analytics.analyticsconfig.md) > [authorizationType](./analytics.analyticsconfig.authorizationtype.md) | ||
|
||
## AnalyticsConfig.authorizationType property | ||
|
||
Used for specifying if an API Key or Bearer Token is used for the authorization property. | ||
|
||
**Signature:** | ||
|
||
```typescript | ||
authorizationType: 'apiKey' | 'bearer'; | ||
``` |
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
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