{"id":18419463,"url":"https://github.com/liftric/vault-client-plugin","last_synced_at":"2025-07-02T17:33:46.633Z","repository":{"id":45425918,"uuid":"244860386","full_name":"Liftric/vault-client-plugin","owner":"Liftric","description":"Gradle plugin to use Vault secrets in build scripts","archived":false,"fork":false,"pushed_at":"2024-08-15T08:27:32.000Z","size":129,"stargazers_count":9,"open_issues_count":5,"forks_count":2,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-06-26T06:09:48.519Z","etag":null,"topics":["automation","gradle-plugin","infrastructure","vault","vault-api","vault-client"],"latest_commit_sha":null,"homepage":"https://plugins.gradle.org/plugin/com.liftric.vault-client-plugin","language":"Kotlin","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/Liftric.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":"2020-03-04T09:35:53.000Z","updated_at":"2024-08-12T09:03:05.000Z","dependencies_parsed_at":"2025-04-07T13:46:50.624Z","dependency_job_id":null,"html_url":"https://github.com/Liftric/vault-client-plugin","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/Liftric/vault-client-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Liftric%2Fvault-client-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Liftric%2Fvault-client-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Liftric%2Fvault-client-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Liftric%2Fvault-client-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Liftric","download_url":"https://codeload.github.com/Liftric/vault-client-plugin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Liftric%2Fvault-client-plugin/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263184842,"owners_count":23427096,"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":["automation","gradle-plugin","infrastructure","vault","vault-api","vault-client"],"created_at":"2024-11-06T04:17:08.329Z","updated_at":"2025-07-02T17:33:46.603Z","avatar_url":"https://github.com/Liftric.png","language":"Kotlin","readme":"# vault-client-plugin (gradle plugin)\n![GitHub](https://img.shields.io/github/license/Liftric/vault-client-plugin)\n![GitHub release (latest by date)](https://img.shields.io/github/v/release/Liftric/vault-client-plugin)\n[![CircleCI](https://circleci.com/gh/Liftric/vault-client-plugin/tree/master.svg?style=svg)](https://circleci.com/gh/Liftric/vault-client-plugin/tree/master)\n\n# Usage\nThe vault address and token will be read from the env:\n`VAULT_ADDR` `VAULT_TOKEN`\n\nYou can also specify a path to a file containing the token (vault login - CLI- automatically creates this).\nThis path can also be specified via env var: `VAULT_TOKEN_FILE_PATH`\n\nYou can specify the token in the vault configuration as well (see below), but that should only be used for testing \nand is highly discouraged. The vaultAddress and vaultTokenFilePath configs should be fine though.\n\nUsage example in you build script:\n\n```kotlin\nimport com.liftric.vault.vault\nimport com.liftric.vault.GetVaultSecretTask\n\nplugins {\n    id(\"com.liftric.vault-client-plugin\") version (\"\u003clatest\u003e\")\n}\nvault {\n    vaultAddress.set(\"http://localhost:8200\")\n    vaultToken.set(\"myroottoken\") // don't do that in production code!\n    vaultTokenFilePath.set(\"${System.getProperty(\"user.home\")}/.vault-token\") // from file is prefered over vaultToken \n    maxRetries.set(2)\n    retryIntervalMilliseconds.set(200)\n}\ntasks {\n    val needsSecrets by creating(GetVaultSecretTask::class) {\n        secretPath.set(\"secret/example\")\n        doLast {\n            val secrets: Map\u003cString, String\u003e = secret.get()\n        }\n    }\n}\n```\n\nSee the `integration-` sub projects for working examples.\n\n## configuration\nAfter the plugin is applied, the vault extension is registered with the following settings: \n\nProperty | Description | default value \n---|---|---\nvaultAddress | vault address to be used | result of `System.getenv()[\"VAULT_ADDR\"]`\nvaultToken | vault token to be used (it's recommend you don't set this in your build file) | result of `System.getenv()[\"VAULT_TOKEN\"]`\nvaultTokenFilePath | vault token file path (if set has precedence over vaultToken) | result of `System.getenv()[\"VAULT_TOKEN_FILE_PATH\"]`\nmaxRetries | vault client max retry count | 5\nretryIntervalMilliseconds | time between vault request retries | 1000\n\n## buildSrc\nYou can also use the plugin directly in you buildSrc code:\n```kotlin\nplugins {\n    `kotlin-dsl`\n}\nrepositories {\n    gradlePluginPortal()\n}\ndependencies {\n    implementation(\"com.liftric.vault:vault-client-plugin:\u003clatest\u003e\")\n}\n```\n\nYou'll need access to the project in your buildSrc code:\n```kotlin\nimport com.liftric.vault.vault\nimport org.gradle.api.Project\n\nobject Configs {\n    fun Project.secretStuff(): Any {\n        val secrets = project.vault(\"secret/example\")\n        [...] // use the secrets\n    }\n    fun Project.secretStuff(): Any {\n        val needsSecrets: GetVaultSecretTask = tasks.getByName\u003cGetVaultSecretTask\u003e(\"needsSecrets\").apply {\n            execute()\n        }\n        val secret = needsSecrets.secret.get()\n        [...] // use the secrets\n    }\n}\n```\nThis can be used in your build scripts like:\n```kotlin\nwith(Configs) {\n    val secretString = secretStuff() \n    [...] // use it\n}\n```\n\nSee `integration-token` for an example.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliftric%2Fvault-client-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fliftric%2Fvault-client-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliftric%2Fvault-client-plugin/lists"}