prismatik / auth-driver Goto Github PK
View Code? Open in Web Editor NEWA driver for Prismatik Auth service.
A driver for Prismatik Auth service.
Currently basic auth is implemented with custom headers as an interceptor for all requests, though axios can support basic auth as an options - from the docs:
// `auth` indicates that HTTP Basic auth should be used, and supplies credentials. // This will set an `Authorization` header, overwriting any existing // `Authorization` custom headers you have set using `headers`. auth: { username: 'janedoe', password: 's00pers3cret' }
I suggest we change the auth-driver
opts
to match axios
opts. So this would change:
{
password: 'secret'
}
to...
{
auth: {
username: 'user',
password: 'secret'
}
}
By doing this it would remove unnecessary code as the functionality is supported natively.
This line https://github.com/Prismatik/auth-driver/blob/master/src/index.js#L96 assumes that the error response includes the property data
.
This isn't always the case as axios
will return Error: connect ECONNREFUSED :::3011
if for example it cannot connect to the service on that defined port.
It would be nice to have a function that allows you to fetch multiple auth records are once given a list of ids. The current search function does not support this.
I don't really see why we need babel for this one. it all could be perfectly expressed in vanilla es6. the .default
imports are kind of ugly and we export one thing only. so think we should kick it out for the sake of consistency
I want to be able to delete auth records for good if i want to. for example for automated testing purposes. at the moment i have to generate uniq emails all the time, which is a bummer and prone to collisions. i want my tests to be pretty
Instead of requiring an instance of auth to be running for tests can could mock the calls instead. Unless there is a publicly accessible test version of auth available that can be used for CI tests eg. Travis ?
Would be nice if this library worked isomorphically, we can also use this as an excuse to transpile ES2015 and take advantage of all the nice features babel gives us.
This is breaking the use case where users have a plus symbol in their email for example [email protected]
.
https://github.com/Prismatik/auth-driver/blob/master/src/index.js#L54
This line should either
Hey,
How about replacing get
with read
to be consistent with create
and update
? get
's antonym is put
, not update
. :)
Also, search
with no params could be replace getAll
.
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.