Skip to content

Commit

Permalink
Merge pull request openbao#106 from cipherboy/add-redis-plugin
Browse files Browse the repository at this point in the history
Part 8/n - Add redis plugin
  • Loading branch information
naphelps committed Feb 2, 2024
2 parents d0fdf53 + cace2d0 commit 3f07265
Show file tree
Hide file tree
Showing 26 changed files with 2,329 additions and 77 deletions.
1 change: 0 additions & 1 deletion command/commands.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import (
auditSocket "github.com/openbao/openbao/builtin/audit/socket"
auditSyslog "github.com/openbao/openbao/builtin/audit/syslog"

credKerb "github.com/hashicorp/vault-plugin-auth-kerberos"
credCert "github.com/openbao/openbao/builtin/credential/cert"
credOIDC "github.com/openbao/openbao/builtin/credential/jwt"
credKerb "github.com/openbao/openbao/builtin/credential/kerberos"
Expand Down
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ require (
github.com/hashicorp/raft-autopilot v0.2.0
github.com/hashicorp/raft-boltdb/v2 v2.0.0-20210421194847-a7e34179d62c
github.com/hashicorp/raft-snapshot v1.0.4
github.com/hashicorp/vault-plugin-auth-kerberos v0.10.0
github.com/hashicorp/vault-plugin-mock v0.16.1
github.com/hashicorp/vault-plugin-secrets-kv v0.15.0
github.com/influxdata/influxdb1-client v0.0.0-20200827194710-b269163b24ab
Expand All @@ -100,6 +99,7 @@ require (
github.com/kr/text v0.2.0
github.com/mattn/go-colorable v0.1.13
github.com/mattn/go-isatty v0.0.19
github.com/mediocregopher/radix/v4 v4.1.4
github.com/mholt/archiver/v3 v3.5.1
github.com/michaelklishin/rabbit-hole/v2 v2.12.0
github.com/mikesmitty/edkey v0.0.0-20170222072505-3356ea4e686a
Expand Down Expand Up @@ -337,6 +337,7 @@ require (
github.com/spf13/pflag v1.0.5 // indirect
github.com/stretchr/objx v0.5.0 // indirect
github.com/tencentcloud/tencentcloud-sdk-go v1.0.162 // indirect
github.com/tilinna/clock v1.0.2 // indirect
github.com/tklauser/go-sysconf v0.3.10 // indirect
github.com/tklauser/numcpus v0.4.0 // indirect
github.com/tv42/httpunix v0.0.0-20191220191345-2ba4b9c3382c // indirect
Expand Down
79 changes: 4 additions & 75 deletions go.sum

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions helper/builtinplugins/registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import (
dbInflux "github.com/openbao/openbao/plugins/database/influxdb"
dbMysql "github.com/openbao/openbao/plugins/database/mysql"
dbPostgres "github.com/openbao/openbao/plugins/database/postgresql"
dbRedis "github.com/openbao/openbao/plugins/database/redis"
"github.com/openbao/openbao/sdk/framework"
"github.com/openbao/openbao/sdk/helper/consts"
"github.com/openbao/openbao/sdk/logical"
Expand Down
15 changes: 15 additions & 0 deletions plugins/database/redis/.github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Overview
A high level description of the contribution, including:
Who the change affects or is for (stakeholders)?
What is the change?
Why is the change needed?
How does this change affect the user experience (if at all)?

# Related Issues/Pull Requests
- [ ] [Issue #1234](https://github.com/hashicorp/vault/issues/1234)
- [ ] [PR #1234](https://github.com/hashicorp/vault/pr/1234)

# Contributor Checklist
- [ ] Add relevant docs to upstream Vault repository, or sufficient reasoning why docs won’t be added yet
- [ ] Add output for any tests not ran in CI to the PR description (eg, acceptance tests)
- [ ] Backwards compatible
8 changes: 8 additions & 0 deletions plugins/database/redis/.github/workflows/acctests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
name: Acceptance Tests

on: push

jobs:
run-acceptance-tests:
uses: hashicorp/vault-workflows-common/.github/workflows/acc-tests.yaml@1540ee539622447caf4c0269252b0d7d1d897dba
secrets: inherit
17 changes: 17 additions & 0 deletions plugins/database/redis/.github/workflows/bulk-dep-upgrades.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Upgrade dependencies
on:
workflow_dispatch:
schedule:
# Runs 12:00AM on the first of every month
- cron: '0 0 1 * *'
jobs:
upgrade:
# using `main` as the ref will keep your workflow up-to-date
uses: hashicorp/vault-workflows-common/.github/workflows/bulk-dependency-updates.yaml@main
secrets:
VAULT_ECO_GITHUB_TOKEN: ${{ secrets.VAULT_ECO_GITHUB_TOKEN }}
with:
# either hashicorp/vault-ecosystem-applications or hashicorp/vault-ecosystem-foundations
reviewer-team: hashicorp/vault-ecosystem-applications
repository: ${{ github.repository }}
run-id: ${{ github.run_id }}
19 changes: 19 additions & 0 deletions plugins/database/redis/.github/workflows/jira.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: Jira Sync
on:
issues:
types: [opened, closed, deleted, reopened]
pull_request_target:
types: [opened, closed, reopened]
issue_comment: # Also triggers when commenting on a PR from the conversation view
types: [created]
jobs:
sync:
uses: hashicorp/vault-workflows-common/.github/workflows/jira.yaml@main
# assuming you use Vault to get secrets
# if you use GitHub secrets, use secrets.XYZ instead of steps.secrets.outputs.XYZ
secrets:
JIRA_SYNC_BASE_URL: ${{ secrets.JIRA_SYNC_BASE_URL }}
JIRA_SYNC_USER_EMAIL: ${{ secrets.JIRA_SYNC_USER_EMAIL }}
JIRA_SYNC_API_TOKEN: ${{ secrets.JIRA_SYNC_API_TOKEN }}
with:
teams-array: '["ecosystem", "applications"]'
47 changes: 47 additions & 0 deletions plugins/database/redis/.github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Tests

on: [push, workflow_dispatch]

jobs:
get-go-version:
name: "Determine Go toolchain version"
runs-on: ubuntu-latest
outputs:
go-version: ${{ steps.get-go-version.outputs.go-version }}
steps:
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- name: Determine Go version
id: get-go-version
run: |
echo "Building with Go $(cat .go-version)"
echo "go-version=$(cat .go-version)" >> $GITHUB_OUTPUT
fmtcheck:
runs-on: ubuntu-latest
needs: [get-go-version]
env:
GOFUMPT_VERSION: 0.3.1
steps:
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
with:
go-version: ${{ needs.get-go-version.outputs.go-version }}
- run: |
go install "mvdan.cc/gofumpt@v${GOFUMPT_VERSION}"
make fmtcheck
test:
runs-on: ubuntu-latest
needs: [get-go-version]
steps:
- uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
- uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 # v4.0.1
with:
go-version: ${{ needs.get-go-version.outputs.go-version }}
- uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- run: make testacc
11 changes: 11 additions & 0 deletions plugins/database/redis/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.DS_Store
.idea
.vscode
pkg/*
bin/*

bootstrap/terraform/.terraform
bootstrap/terraform/terraform.tfstate
bootstrap/terraform/terraform.tfstate.backup
bootstrap/terraform/local_environment_setup.sh
scripts/tests/tls
1 change: 1 addition & 0 deletions plugins/database/redis/.go-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1.20.7
18 changes: 18 additions & 0 deletions plugins/database/redis/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
## Unreleased

## v0.2.2
IMPROVEMENTS:
* Updated dependencies:
* `github.com/hashicorp/vault/sdk` v0.9.0 -> v0.9.2
* `github.com/mediocregopher/radix/v4` v4.1.2 -> v4.1.4
* `github.com/ory/dockertest/v3` v3.9.1 -> v3.10.0

## v0.2.1
* Dependency upgrades

## v0.2.0
* No feature changes

## v0.1.0

* Initial release of the Redis database secrets engine for Vault
Loading

0 comments on commit 3f07265

Please sign in to comment.