{"id":19150599,"url":"https://github.com/night-crawler/vaultpost","last_synced_at":"2026-05-15T11:34:19.832Z","repository":{"id":72429468,"uuid":"86924863","full_name":"night-crawler/vaultpost","owner":"night-crawler","description":"Using Vault to generate short lifetime postgresql creds for Django","archived":false,"fork":false,"pushed_at":"2017-04-01T15:59:35.000Z","size":2,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-22T20:46:43.145Z","etag":null,"topics":["django","django-database","vault"],"latest_commit_sha":null,"homepage":"","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/night-crawler.png","metadata":{"files":{"readme":"README.md","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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-04-01T15:59:28.000Z","updated_at":"2017-04-01T16:02:09.000Z","dependencies_parsed_at":"2023-09-17T13:31:04.970Z","dependency_job_id":null,"html_url":"https://github.com/night-crawler/vaultpost","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/night-crawler/vaultpost","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/night-crawler%2Fvaultpost","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/night-crawler%2Fvaultpost/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/night-crawler%2Fvaultpost/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/night-crawler%2Fvaultpost/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/night-crawler","download_url":"https://codeload.github.com/night-crawler/vaultpost/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/night-crawler%2Fvaultpost/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33065506,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-13T13:14:54.681Z","status":"online","status_checked_at":"2026-05-15T02:00:06.351Z","response_time":103,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["django","django-database","vault"],"created_at":"2024-11-09T08:12:26.326Z","updated_at":"2026-05-15T11:34:19.815Z","avatar_url":"https://github.com/night-crawler.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Inspired by https://github.com/jdelic/django-postgresql-setrole\n\nhttps://github.com/hashicorp/vault/issues/1857#issuecomment-248441989\n\n```python\nclient.write(\n    join(PG_MOUNT, 'config/connection'),\n    lease='10s', lease_max='10s',\n    connection_url='postgresql://'\n                   'vault:azaza'\n                   '@trash.force.fm:5432/postgres'\n)\nclient.write(\n    join(PG_MOUNT, 'roles', 'db-full-access'),\n    sql=\"\"\"\n    CREATE ROLE \"{{name}}\"\n        WITH LOGIN ENCRYPTED PASSWORD '{{password}}'\n        VALID UNTIL '{{expiration}}'\n        IN ROLE \"force_fm\" INHERIT NOCREATEROLE NOCREATEDB NOSUPERUSER NOREPLICATION NOBYPASSRLS;\n    \"\"\",\n    revocation_sql=\"\"\"\n    DROP ROLE \"{{name}}\";\n    \"\"\"\n)\n```\n\n```python\nDATABASES = {\n    'default': {\n        'NAME': 'force_fm',\n        'ENGINE': 'pgvault',\n        'HOST': 'trash.force.fm',\n        'USER': 'force_fm',  # SET ROLE USER\n        'PORT': '',\n        'CONN_MAX_AGE': 6000,\n        'VAULT': {\n            'URL': 'https://trash.force.fm:18400',\n            'TOKEN': '',\n            'MOUNT': 'force.fm/postgresql',\n            'ROLE': 'db-full-access',\n            'CERTS': (\n                os.path.join(CERTS_DIR, 'client1__bundle.crt'),\n                os.path.join(CERTS_DIR, 'client1.key'),\n            ),\n            'VERIFY': os.path.join(CERTS_DIR, 'force.fm__root_ca.crt'),\n        }\n    }\n}\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnight-crawler%2Fvaultpost","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnight-crawler%2Fvaultpost","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnight-crawler%2Fvaultpost/lists"}