Changes for refresh amazon app client secret#88
Conversation
Piyush19feb
left a comment
There was a problem hiding this comment.
@nitinbhakar small suggestion.
Please Check
| @@ -0,0 +1,20 @@ | |||
| module MuffinMan::ApiAccountCredential | |||
There was a problem hiding this comment.
Maybe this should just be like how the other APIs have been implemented where a sp api client can be created for Application Management API v2023-11-30.
lib/muffin_man/lwa/auth_helper.rb
Outdated
| JSON.parse(response.body)["refresh_token"] | ||
| end | ||
|
|
||
| def self.get_client_credential_refresh_token(client_id, client_secret) |
There was a problem hiding this comment.
@nitinbhakar @sanjjaymahalingam I am not sure about this can you check once, in muffin man sp_api_client.rb we have method called retrieve_lwa_access_token will that be useful to generate the refresh_token? and then use for client creation?
There was a problem hiding this comment.
@rohit-lingayat-sd Yes that can be useful but thats a private method so can't call it directly.
So should i use send() to call private method?
There was a problem hiding this comment.
hmm no, then we can go with your approach then
| @@ -0,0 +1,20 @@ | |||
| module MuffinMan::ApiAccountCredential | |||
There was a problem hiding this comment.
hmm can we have something like this MuffinMan::Credential::V20231130 ?
| @@ -0,0 +1,20 @@ | |||
| module MuffinMan::Credential | |||
There was a problem hiding this comment.
this is usually named as mentioned in the SP-API documentation. So this would be MuffinMan::ApplicationManagement
| "x-amz-access-token" => "#{access_token}" | ||
| } | ||
| ) | ||
| if response.code != 204 |
There was a problem hiding this comment.
just returning the response would be better as users of the client can decide further action.
muffin_man changes for refresh of amazon app client secret expiry.