{"id":13667670,"url":"https://github.com/stealthycoin/chalice-cognito-auth","last_synced_at":"2026-01-14T08:53:37.578Z","repository":{"id":62561697,"uuid":"193434043","full_name":"stealthycoin/chalice-cognito-auth","owner":"stealthycoin","description":"Auth lib for Chalice cognito authentication.","archived":false,"fork":false,"pushed_at":"2022-12-09T10:55:37.000Z","size":36,"stargazers_count":16,"open_issues_count":4,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-30T11:13:53.034Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stealthycoin.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-06-24T04:33:08.000Z","updated_at":"2024-03-04T22:20:01.000Z","dependencies_parsed_at":"2023-01-25T21:31:46.095Z","dependency_job_id":null,"html_url":"https://github.com/stealthycoin/chalice-cognito-auth","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/stealthycoin/chalice-cognito-auth","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stealthycoin%2Fchalice-cognito-auth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stealthycoin%2Fchalice-cognito-auth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stealthycoin%2Fchalice-cognito-auth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stealthycoin%2Fchalice-cognito-auth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stealthycoin","download_url":"https://codeload.github.com/stealthycoin/chalice-cognito-auth/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stealthycoin%2Fchalice-cognito-auth/sbom","scorecard":{"id":850016,"data":{"date":"2025-08-11","repo":{"name":"github.com/stealthycoin/chalice-cognito-auth","commit":"524f84d7a357f552797c6c01d931c04cad8a7c54"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.6,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Code-Review","score":0,"reason":"Found 0/25 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"License","score":0,"reason":"license file not detected","details":["Warn: project does not have a license file"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 7 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-23T22:14:53.319Z","repository_id":62561697,"created_at":"2025-08-23T22:14:53.319Z","updated_at":"2025-08-23T22:14:53.319Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28414713,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T08:38:59.149Z","status":"ssl_error","status_checked_at":"2026-01-14T08:38:43.588Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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-08-02T07:00:45.945Z","updated_at":"2026-01-14T08:53:37.556Z","avatar_url":"https://github.com/stealthycoin.png","language":"Python","funding_links":[],"categories":["Made with Chalice"],"sub_categories":[],"readme":".. image:: https://badge.fury.io/py/chalice-cognito-auth.svg\n    :target: https://badge.fury.io/py/chalice-cognito-auth\n.. image:: https://travis-ci.org/stealthycoin/chalice-cognito-auth.svg?branch=master\n    :target: https://travis-ci.org/stealthycoin/chalice-cognito-auth\n\nPurpose\n=======\n\nA Library for setting up login routes in a Chalice app.\n\n\nBasic Usage\n===========\n\nBelow is an example of a basic application making use of a Cognito User Pool.\n\nFirst set up a new Chalice app::\n\n  $ chalice new-project test-auth\n  $ cd test-auth\n\n\nNext we add ``chalice-cognito-auth`` as a dependency::\n\n  $ echo \"chalice-cognito-auth\" \u003e\u003e requirements.txt\n\n\nNow update the ``app.py`` file to configure a default user pool handler.\n\n\n.. code:: python\n\n    from chalice import Chalice\n\n    import chalice_cognito_auth\n\n\n    app = Chalice(app_name='test-auth')\n\n    app.experimental_feature_flags.update([\n\t'BLUEPRINTS',\n    ])\n\n    user_pool_handler = chalice_cognito_auth.default_user_pool_handler()\n    app.register_blueprint(user_pool_handler.blueprint)\n\n\n    @app.route('/whoami', authorizer=user_pool_handler.auth)\n    def index():\n\treturn {\n\t    'username': user_pool_handler.current_user\n\t}\n\n\nThis will create a ``UserPoolHandler`` object using the environment variables\n``APP_CLIENT_ID`` for the Cognito Userpool application client id. ``POOL_ID``\nfor the ID of the Cognito Userpool itself. And ``AWS_REGION`` for the\nregion. ``AWS_REGION`` is set by the AWS Lambda runtime, but the other two we\nneed to set ourselves. Update the file ``.chalice/config.json`` to look\nsomething like the following::\n\n    {\n\t\"version\": \"2.0\",\n\t\"app_name\": \"test-auth\",\n\t\"environment_variables\": {\n\t    \"APP_CLIENT_ID\": \"...client id here...\",\n\t    \"POOL_ID\": \"...pool id here...\"\n\t},\n\t\"stages\": {\n\t    \"dev\": {\n\t\t\"api_gateway_stage\": \"api\"\n\t    }\n\t}\n    }\n\n\nSubstitute the client id and pool id values for ones that match an existing\ncognito user pool you have and can use for testing.\n\nNow deploy the application using::\n\n  $ chalice deploy\n  Creating deployment package.\n  Updating policy for IAM role: test-auth-dev\n  Updating lambda function: test-auth-dev\n  Updating lambda function: test-auth-dev-UserPoolAuth\n  Updating rest API\n  Resources deployed:\n    - Lambda ARN: arn:aws:lambda:us-west-2:...:function:test-auth-dev\n    - Lambda ARN: arn:aws:lambda:us-west-2:...:function:test-auth-dev-UserPoolAuth\n    - Rest API URL: https://id.execute-api.us-west-2.amazonaws.com/api/\n\nNow that it has been deployed we can access the API using the Rest API\nURL. chalice-cognito-auth injects a ``login`` route which accepts a ``POST``\nrequest with a JSON payload containing the two keys ``username`` and\n``password``. Make sure your configured userpool has a user in it that can be\nused for testing and send something like the following::\n\n  $ curl -X POST -H Content-Type:application/json https://id.execute-api.us-west-2.amazonaws.com/api/login -d '{\"username\":\"StealthyCoin\", \"password\": \"secret\"}'\n  {\"id_token\":\"...\",\"refresh_token\":\"...\",\"access_token\":\"...\",\"token_type\":\"Bearer\"}\n\n\nThe above JSON response contains all the tokens needed to send authorized\nrequests. To test our authorizer we will use the ``whoami`` route which simply\ntakes a request and either rejects it if unauthorized, or sends back the\nusername associated with the request. To do this we will send a ``GET`` request\nwith an ``Authorization`` header with the value of our ``id_token`` from the\nresult JSON above.\n\nIn my case::\n\n  $ curl -H Authorization:...id token here... https://id.execute-api.us-west-2.amazonaws.com/api/whoami\n  {\"username\":\"StealthyCoin\"}\n\nWhich sends back JSON object with the username that goes with my id token.\n\nTo check that a requset with a bad authorization token is rejected, run the\nfollowing curl command::\n\n  $ curl -H Authorization:foobar https://id.execute-api.us-west-2.amazonaws.com/api/whoami\n  {\"Message\":\"User is not authorized to access this resource\"}\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstealthycoin%2Fchalice-cognito-auth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstealthycoin%2Fchalice-cognito-auth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstealthycoin%2Fchalice-cognito-auth/lists"}