{"id":19516035,"url":"https://github.com/edeca/simpledb-userdb","last_synced_at":"2025-02-25T23:44:00.942Z","repository":{"id":136937741,"uuid":"155624532","full_name":"edeca/simpledb-userdb","owner":"edeca","description":"A lightweight user authentication framework, built around AWS SimpleDB","archived":false,"fork":false,"pushed_at":"2018-11-03T15:12:00.000Z","size":23,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-08T12:38:18.592Z","etag":null,"topics":["aws","python3","simpledb","user-management"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/edeca.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-10-31T21:17:03.000Z","updated_at":"2018-11-03T15:12:02.000Z","dependencies_parsed_at":null,"dependency_job_id":"8ddfc20b-1b0c-4faf-ac26-51b8d58f15e2","html_url":"https://github.com/edeca/simpledb-userdb","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/edeca%2Fsimpledb-userdb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edeca%2Fsimpledb-userdb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edeca%2Fsimpledb-userdb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/edeca%2Fsimpledb-userdb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/edeca","download_url":"https://codeload.github.com/edeca/simpledb-userdb/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240766672,"owners_count":19854114,"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":["aws","python3","simpledb","user-management"],"created_at":"2024-11-10T23:44:02.804Z","updated_at":"2025-02-25T23:44:00.886Z","avatar_url":"https://github.com/edeca.png","language":"Python","readme":"# Introduction\n\nThe module is an easy way to build a user database on top of AWS SimpleDB.  It is designed a very lightweight implementation of user/password authentication for cloud based services.\n\nThis makes it trivial to use in AWS projects that require authentication, for example web services, Lambda, etc.\n\n# Key features\n\n * Simple interface to add, edit or authenticate users.\n * Built in ability to disable or expire users.\n * Passwords stored using bcrypt for sensible security.\n * Resistance to [timing attacks](https://github.com/OWASP/railsgoat/wiki/A2-Insecure-Compare-and-Timing-Attacks).\n * Custom data can be stored per-user (see notes).\n\n# Installation\n\nInstall the latest version from pip:\n\n```\npip install simpledb_userdb\n```\n\n# Example\n\nThe following example:\n\n * initialises the module\n * adds a user\n * adds a role for the user (an arbitrary text string)\n * updates the users password\n * performs a number of authentication attempts\n\n```python\nfrom simpledb_userdb import UserDatabase\n\ndb = UserDatabase()\nif db.connect(\"eu-west-1\", \"myapp_users\"):\n\n    # Add the user and add roles\n    db.create_user(\"alice\", \"l0vecrypt0!\")\n    db.add_user_role(\"alice\", \"administrator\")\n    db.add_user_role(\"alice\", \"user\")\n\n    # This should return success\n    print(db.authenticate(\"alice\", \"l0vecrypt0!\"))\n\n    # This is the wrong password\n    print(db.authenticate(\"alice\", \"p4ssw0rd!\"))\n\n    # Change Alice's password, only the updated attributes\n    # need to be passed.\n    db.update_user(\"alice\", password=\"p4ssw0rd!\")\n\n    # This user doesn't exist\n    print(db.authenticate(\"bob\", \"h4cks\"))\n```\n\nTo cleanup:\n\n```python\ndb = UserDatabase()\nif db.connect(\"eu-west-1\", \"myapp_users\"):\n    # Warning: cannot be undone!\n    db.delete_db()\n```\n\nSee the documentation for further options.\n\n# Notes\n\n## Information storage\n\nInformation stored per user is purposefully minimal, for example there is no field for name, email or last IP.  This is a design choice to keep the API simple and reduce the amount of personal data in the backend.  An email address can be used as the username if desired, and other details can be stored as extra data in the user object.\n\n## Additional data\n\nAdditional data can be stored for a user as a Python `dict`, which is serialised to JSON for the database.  These attributes cannot be searched and SimpleDB will charge for storage space.\n\n## Credentials\n\nCredentials for AWS are typically required (except for Lambda).  The module contains no mechanism to authenticate with AWS, please provide credentials in a file or environment variable (see the [Boto 3 docs](https://boto3.amazonaws.com/v1/documentation/api/latest/guide/configuration.html)).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedeca%2Fsimpledb-userdb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fedeca%2Fsimpledb-userdb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fedeca%2Fsimpledb-userdb/lists"}