{"id":22519444,"url":"https://github.com/hydrogen-dev/raindrop-sdk-python","last_synced_at":"2025-07-26T13:08:38.226Z","repository":{"id":55658319,"uuid":"127971778","full_name":"hydrogen-dev/raindrop-sdk-python","owner":"hydrogen-dev","description":null,"archived":false,"fork":false,"pushed_at":"2020-12-14T20:33:34.000Z","size":70,"stargazers_count":11,"open_issues_count":1,"forks_count":5,"subscribers_count":16,"default_branch":"master","last_synced_at":"2024-11-29T02:24:34.709Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hydrogen-dev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-04-03T21:39:38.000Z","updated_at":"2022-09-02T16:58:40.000Z","dependencies_parsed_at":"2022-08-15T05:50:17.228Z","dependency_job_id":null,"html_url":"https://github.com/hydrogen-dev/raindrop-sdk-python","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hydrogen-dev%2Fraindrop-sdk-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hydrogen-dev%2Fraindrop-sdk-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hydrogen-dev%2Fraindrop-sdk-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hydrogen-dev%2Fraindrop-sdk-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hydrogen-dev","download_url":"https://codeload.github.com/hydrogen-dev/raindrop-sdk-python/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228558673,"owners_count":17936725,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-07T04:20:22.093Z","updated_at":"2024-12-07T04:20:22.648Z","avatar_url":"https://github.com/hydrogen-dev.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Hydro Raindrop\nThis package provides a suite of convenience functions intended to simplify the integration of Hydro's [Raindrop authentication](https://www.hydrogenplatform.com/hydro) into your project. An equivalent [Javascript SDK](https://github.com/hydrogen-dev/raindrop-sdk-js) is also available. More information, including detailed API documentation, is available in the [Raindrop documentation](https://www.hydrogenplatform.com/docs/hydro/v1/#Raindrop). Raindrop comes in two flavors:\n\n## Client-side Raindrop\nClient-side Raindrop is a next-gen 2FA solution. We've open-sourced the [code powering Client-side Raindrop](https://github.com/hydrogen-dev/smart-contracts/tree/master/client-raindrop).\n\n\n## Server-side Raindrop\nServer-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](https://github.com/hydrogen-dev/smart-contracts/tree/master/hydro-token-and-raindrop-enterprise).\n\n\n## Installation\n### Recommended\nInstall [raindrop on pypi](https://pypi.org/project/raindrop/). Supports Python \u003e=3.6.\n```\npip install raindrop\n```\n\n## Getting started\nThe `raindrop` package defines two classes that you will interact with: `ServerRaindropPartner` and `ClientRaindropPartner`. To start making API calls, you'll need to instantiate each object. The SDK will automatically fetch you an [OAuth token](https://www.hydrogenplatform.com/docs/hydro/v1/#Authentication), and set [your environment](https://www.hydrogenplatform.com/docs/hydro/v1/#Environment).\n\n## `ClientRaindropPartner` Functions\n```python\nClientRaindropPartner('Sandbox', 'your_id', 'your_secret', 'your_application_id')\n```\n- `environment` (required): `Sandbox` | `Production` to set your environment\n- `client_id` (required): Your OAuth id for the Hydro API\n- `client_secret` (required): Your OAuth secret for the Hydro API\n- `application_id` (required): Your application id for the Hydro API\n\n### `register_user(hydro_id)`\nShould be called when a user elects to use Raindrop Client for the first time with your application.\n- `hydro_id`: the new user's HydroID (the one they used when signing up for Hydro mobile app)\n\n### `verify_signature(hydro_id, message)`\nShould be called each time you need to verify whether a user has signed a message.\n- `hydro_id`: the HydroID of the user that is meant to have signed `message`\n- `message`: a message generated from `generate_message()` (or any 6-digit numeric code)\n\nReturns a tuple that looks like: `(true|false, {...})`. The first tuple element will only be `true` for successful verification attempts.\n\n### `unregister_user(hydro_id)`\nShould be called when a user disables Client-side Raindrop with your application.\n- `hydro_id`: the user's Hydro HydroID (the one they used when signing up for Hydro mobile app)\n\n### `generate_message()`\nGenerates a random 6-digit integers for users to sign. Uses system-level CSPRNG.\n\n\n## `ServerRaindropPartner` Functions\n```python\nServerRaindropPartner('Sandbox', 'your_id', 'your_secret')\n```\n- `environment` (required): `Sandbox` | `Production` to set your environment\n- `client_id` (required): Your OAuth id for the Hydro API\n- `client_secret` (required): Your OAuth secret for the Hydro API\n\n### `whitelist(address)`\nA one-time call that whitelists a user to authenticate with your API via Server-side Raindrop.\n- `address`: The Ethereum address of the user you're whitelisting\n\n### `request_challenge(hydro_address_id)`\nInitiate an authentication attempt on behalf of the user associated with `hydro_address_id`.\n- `hydro_address_id`: the `hydro_address_id` of the authenticating user\n\n### `authenticate(hydro_address_id)`\nChecks whether the user correctly performed the raindrop.\n- `hydro_address_id`: the `hydro_address_id` of the user who claims to be authenticated\n\nReturns a tuple that looks like: `(true|false, {...})`. The first tuple element will only be `true` for successful authentication attempts.\n\n\n## Generic Functions\n### `refresh_token()`\nManually refreshes OAuth token.\n\n### `transactionStatus(transaction_hash)`\nThis 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`).\n- `transaction_hash` (required): Hash of a transaction\n\n## `Note:`\nMany of the above functions have optional parameters `raise_for_status` and `return_json`. These parameters turn status code error handling and json return values on/off. They are set to sensible defaut parameters.\n\n\n## Copyright \u0026 License\nCopyright 2018 The Hydrogen Technology Corporation under the GNU General Public License v3.0.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhydrogen-dev%2Fraindrop-sdk-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhydrogen-dev%2Fraindrop-sdk-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhydrogen-dev%2Fraindrop-sdk-python/lists"}