Skip to content
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

Why does Listing#variations require secure? #122

Open
kaoru opened this issue Jul 5, 2017 · 4 comments
Open

Why does Listing#variations require secure? #122

kaoru opened this issue Jul 5, 2017 · 4 comments

Comments

@kaoru
Copy link

kaoru commented Jul 5, 2017

https://github.com/kytrinyx/etsy/blob/master/lib/etsy/listing.rb#L145

def variations(options={})
  options.merge!(:require_secure => true)
  self.class.get_all("/listings/#{id}/variations", oauth.merge(options))
end

Is there any reason for this to have the require_secure parameter set? It seems to work without it.

irb(main):093:0> listing = Etsy::Listing.find('193989447')

irb(main):094:0> listing.variations
RuntimeError: Secure connection required. Please provide your OAuth credentials via :access_token and :access_secret in the parameters

irb(main):109:0> Etsy::Listing.get_all("/listings/#{listing.id}/variations", listing.send(:oauth)).flat_map { |l| l.result.fetch('options').map { |v| v.fetch('value') } }
=> ["A4 (21 x 29.7cm)", "A3 (29.7 x 42cm)"]

Thanks.

@kaoru
Copy link
Author

kaoru commented Jul 5, 2017

I think this could be related to #107 and #108 ?

@kytrinyx
Copy link
Collaborator

@kaoru I'm not sure. For a while listing variations were coming back empty, and I seem to recall that adding oauth to the call caused the variations to come back, but it's been a while and I don't recall the details.

If it now works without it I'd gladly accept a change that removes the secure requirement.

@kaoru
Copy link
Author

kaoru commented Jul 26, 2017

@kytrinyx cool, I'll see if I can write up a pull request for you 👍

Sadly my Etsy app is "waiting for approval" so until the folks over at Etsy can approve it this is probably going to wallow near the bottom of my priority list 😄

@kytrinyx
Copy link
Collaborator

@kaoru Totally understand. Since I no longer have any Etsy apps, this tends to wallow at the bottom of mine as well ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants