This package provides a suite of convenience functions intended to simplify the integration of Hydro's Raindrop authentication into your project. An equivalent Python SDK is also available. More information, including detailed API documentation, is available in the Raindrop documentation. Raindrop comes in two flavors:
Client-side Raindrop is a next-gen 2FA solution. We've open-sourced the code powering Client-side Raindrop.
Server-side Raindrop is an enterprise-level security protocol to secure APIs and other shared resources. We've open-sourced the code powering Server-side Raindrop.
Install raindrop on pypi. Supports Python >=3.6.
pip install raindrop
The raindrop
package defines two classes that you will interact with: ServerRaindropPartner
and ClientRaindropPartner
. To start making API calls, you'll need to instantiate a each object. The SDK will automatically fetch you an OAuth token, and set your environment.
ClientRaindropPartner('Sandbox', 'your_id', 'your_secret', 'your_application_id')
environment
(required):Sandbox
|Production
to set your environmentclient_id
(required): Your OAuth id for the Hydro APIclient_secret
(required): Your OAuth secret for the Hydro APIapplication_id
(required): Your application id for the Hydro API
Should be called when a user elects to use Raindrop Client for the first time with your application.
username
: the new user's Hydro username (the one they used when signing up for Hydro mobile app)
Should be called each time you need to verify whether a user has signed a message.
username
: the username of the user that is meant to have signedmessage
message
: a message generated fromgenerate_message()
(or any 6-digit numeric code)
Should be called when a user disables Client-side Raindrop with your application.
username
: the user's Hydro username (the one they used when signing up for Hydro mobile app)
Generates a random 6-digit integers for users to sign. Uses system-level CSPRNG.
ServerRaindropPartner('Sandbox', 'your_id', 'your_secret')
environment
(required):Sandbox
|Production
to set your environmentclient_id
(required): Your OAuth id for the Hydro APIclient_secret
(required): Your OAuth secret for the Hydro API
A one-time call that whitelists a user to authenticate with your API via Server-side Raindrop.
address
: The Ethereum address of the user you're whitelisting
Initiate an authentication attempt on behalf of the user associated with hydro_address_id
.
hydro_address_id
: thehydro_address_id
of the authenticating user
Checks whether the user correctly performed the raindrop.
hydro_address_id
: thehydro_address_id
of the user who claims to be authenticated
Manually refreshes OAuth token.
This function returns true when the transaction referenced by transaction_hash
has been included in a block on the Ethereum blockchain (Rinkeby if the environment is Sandbox
, Mainnet if the environment is Production
).
transaction_hash
(required): Hash of a transaction
Copyright 2018 The Hydrogen Technology Corporation under the GNU General Public License v3.0.