sqreen / devise_sqreener Goto Github PK
View Code? Open in Web Editor NEWGet more information about devise users through sqreen enrich
License: MIT License
Get more information about devise users through sqreen enrich
License: MIT License
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.
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
$ bundle install
$ export SQREEN_API_TOKEN=YOUR_TOKEN_HERE
with the token from the new sqreen app you've set up$ rails c
At this point, we confirm that the token is properly loaded into the Sqreener class:
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 --
User.sqreener.sqreen_email('[email protected]')
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.
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"
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!)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.