-
Notifications
You must be signed in to change notification settings - Fork 6
Changes for refresh amazon app client secret #88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
nitinbhakar
merged 8 commits into
master
from
INT-5910_Threepn-Automate-the-refresh-of-Amazon-app-client-secret-stage
Jan 24, 2025
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
0f37271
muffin_man changes for refresh amazon app client secret
nitinbhakar 9adff6c
lint fix
nitinbhakar 9719d32
do suggested changes
nitinbhakar 4335859
updating credentials module as per std
nitinbhakar cfeb61a
rubocop fix
nitinbhakar 0a26be2
add rspec
nitinbhakar 5b12f0a
rspec fix
nitinbhakar 35e1949
Do suggested changes
nitinbhakar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| # frozen_string_literal: true | ||
|
|
||
| module MuffinMan | ||
| module ApplicationManagement | ||
| class V20231130 | ||
| def self.rotate_application_client_secret(access_token) | ||
| Typhoeus.post( | ||
| "https://sellingpartnerapi-na.amazon.com/applications/2023-11-30/clientSecret", | ||
| headers: { "x-amz-access-token" => access_token } | ||
| ) | ||
| end | ||
| end | ||
| end | ||
| end |
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| # frozen_string_literal: true | ||
|
|
||
| RSpec.describe MuffinMan::ApplicationManagement::V20231130 do | ||
| let(:access_token) { "test_access_token" } | ||
| let(:new_app_credential_url) { "https://sellingpartnerapi-na.amazon.com/applications/2023-11-30/clientSecret" } | ||
|
|
||
| describe ".rotate_application_client_secret" do | ||
| let(:response) { instance_double(Typhoeus::Response) } | ||
|
|
||
| before do | ||
| allow(Typhoeus).to receive(:post).and_return(response) | ||
| end | ||
|
|
||
| context "when the request is successful (204)" do | ||
| before do | ||
| allow(response).to receive(:code).and_return(204) | ||
| allow(response).to receive(:body).and_return("") | ||
| end | ||
|
|
||
| it "returns the response and makes the correct API call" do | ||
| expect(Typhoeus).to receive(:post).with( | ||
| new_app_credential_url, | ||
| headers: { "x-amz-access-token" => access_token } | ||
| ) | ||
|
|
||
| result = described_class.rotate_application_client_secret(access_token) | ||
| expect(result).to eq(response) | ||
| end | ||
| end | ||
| end | ||
| end |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.