Giter Club home page Giter Club logo

devise_sqreener's People

Contributors

zetaben avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

devise_sqreener's Issues

Token consumption issue in API calls by DeviseSqreener#Sqreen?

  • I've read and understood the Contributing guidelines and have done my best effort to follow them.
  • I've read and agree to the Code of Conduct.
  • I've searched for any related issues and avoided creating a duplicate issue.

Description

Hey, let me first say thanks -- Sqreen is a wonderful service that helps me sleep better at night and I am very grateful for the work you all have put into it.

I've spent some time trying to rig devise_sqreener for some extra coverage on a project I maintain that's covered by service-level sqreen, and I'm having a little bit of difficulty. I apologize if this is a just me thing! It seems like either the API calls made by DeviseSqreener#Sqreen are either dropping the token or expecting something else than I'm giving it, and I can't quite figure out why. Steps to reproduce and a minimal reproduction app are included.

Reproducible in:

devise_sqreener version: 0.1.1
Rails version: 5.1
Ruby version: 2.4.3 (though also getting this failure on 2.5.1)
OS version(s): Mac OS High Sierra 10.13.4

Steps to reproduce:

  1. Create a new sqreen app, application environment development, and get the API key
  2. Clone https://github.com/colinxfleming/sqreencheck , a minimal reproduction I made that sets up devise and devise_sqreener
  3. $ bundle install
  4. $ export SQREEN_API_TOKEN=YOUR_TOKEN_HERE with the token from the new sqreen app you've set up
  5. $ rails c

At this point, we confirm that the token is properly loaded into the Sqreener class:

  1. User.class.sqreener #=> #<DeviseSqreener::Sqreen:0x00007fde292cbc58 @sqreen_api_token="YOUR_TOKEN_HERE">

And we try to make the call -- I think this is basically what happens on login or user create --

  1. User.sqreener.sqreen_email('[email protected]')

Expected result:

Based on the docs, I think I'm expecting a hash of the data back, since I'm making a request with the library containing an API token.

Actual result:

Request response was a 401 so it returned nil. The response body is as follows, which seems to indicate that either the token is getting dropped somehow, the token is bad for reasons I can't quite determine, or the API is expecting a different token than I think it does.

"{\"code\":401,\"details\":null,\"errno\":4011,\"error\":\"Unauthorized\",\"info\":null,\"message\":\"No key was found in this request. You can retrieve your free API key at https://www.sqreen.io/developers\"}\n" 

Attachments:

https://github.com/colinxfleming/sqreencheck

Thanks very much for your time, and let me know if there's anything I can do to be helpful (or if I'm doing something silly by accident, in which case, sorry about that!)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.