Comments (6)
I hadn't thought about it but I could definitely see it being a useful thing. I haven't looked too much into handling of the connections like this (parallel) but it could definitely be an interesting addition.
It does make use of the Guzzle HTTP client, though, which does make supporting these kinds of parallel connections simpler on the HTTP level. It'd just be a matter of wrapping that handling correctly in the request process. I see in your library you've used the cURL multi handling to make the same kind of thing happen. I think there could be some added benefit to using the Guzzle wrapper for it in terms of determining the "first in" without having to muck with the HTTP level requests manually.
from yubikey.
Additionally, I'd like to move the current hosts
list to a default kind of thing and allow for the injection of one or more servers. I could see a host setter with ($hosts, $overwrite = false)
to make setting these servers easier. Then add a flag to the constructor (boolean) of whether to use the parallel or single request as it does now.
from yubikey.
In looking at what you have in your library so far, it looks like you're still waiting for all of the requests to finish out. You're just using the first one returned as the result. Is this the correct use case you're shooting for here?
from yubikey.
Hmm, I think I have something cooperating with a curl multi request but it looks like the API servers don't operate independently. I get an OK on the first few but then start getting a REPLAYED_REQUEST
closer to the end of the list. If they're not all evaluating them independently, why even have multi-threaded requests? Please correct me if I'm wrong on this one...
from yubikey.
Okay, so if you enable multiple server checking and the "first in" parameter, you can call it like this:
$v = new \Yubikey\Validate($apiKey, $clientId);
$response = $v->check($inputtedKey, true);
echo ($response->success(true) === true) ? 'success!' : 'you failed. aw.';
Note the two new true
parameters there. If those are left off or set to false, it will only check one server.
from yubikey.
Since this is implemented I'm going to close this one out. If there's any issues, open a new issue with it.
from yubikey.
Related Issues (19)
- Please create a release HOT 3
- Timing Attacks on Signature Validation
- a + in the signature is encoded twice HOT 2
- Current composer release doesn't work HOT 2
- Add a "providers" directory
- Add a function to get the public key HOT 6
- manual installation HOT 9
- tl
- clarify LICENSE HOT 1
- Incompatable with Windows HOT 1
- Failing build
- new release for new requirements HOT 10
- Deprecated Warning When Validating YubiKey OTP Despite Using the Latest Version HOT 6
- Check response signature HOT 8
- Check at least one server response HOT 3
- Add "sl" and "timeout" params to the request
- Add a check to ensure curl is enabled
- Move to using openssl for nonce generation HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yubikey.