Fetch API key from stash server configuration#4
Open
xmapdev wants to merge 1 commit intothismanyboyfriends2:mainfrom
Open
Fetch API key from stash server configuration#4xmapdev wants to merge 1 commit intothismanyboyfriends2:mainfrom
xmapdev wants to merge 1 commit intothismanyboyfriends2:mainfrom
Conversation
Fixes an issue where the application does not include an API key in the connection fragment given to the plugin upon initialization, but still requires an API key for authentication with the GraphQL endpoint. In this case, a session cookie is provided instead. However, the GraphQL client and wrapper does not support authenticating via cookies. In this scenario, subsequent calls to the GraphQL endpoint fails since no API key is provided. This commit adds a helper function that is used to retrieve the API key if it is missing from the connection fragment upon plugin load. The API key is then used in subsequent calls to the application.
4b444f5 to
b12a22c
Compare
|
Thanks for this patch @xmapdev I found it useful. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes an issue where the application does not include an API key in the connection fragment given to the plugin upon initialization, but still requires an API key for authentication with the GraphQL endpoint.
In this case, a session cookie is provided instead. However, the GraphQL client and wrapper does not support authenticating via cookies. Subsequent calls to the GraphQL endpoint fails with an
401 Unauthorizederror since no API key is provided.This commit adds a helper function that retrieves the API key using
StashInterfacefromstashapi.stashapp, which supports any authentication method provided in the server connection fragment given to the plugin. The key is then passed in subsequent calls to the application. This package should already be present due to the plugin depending onstashapp-tools.Attached is a log file showing the error raised when an API key is missing from the initial configuration fragment passed to the plugin.
out.log