Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add OSS stub functions for Self-Managed Static Roles #28199

Merged
merged 6 commits into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions changelog/28199.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:feature
**Self-Managed Static Roles**: Self-Managed Static Roles are now supported for select SQL database engines (Postgres, Oracle). Requires Vault Enterprise.
```
7 changes: 7 additions & 0 deletions sdk/database/dbplugin/v5/database.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,13 @@ type UpdateUserRequest struct {
// Expiration indicates the new expiration date to change to.
// If nil, no change is requested.
Expiration *ChangeExpiration

// SelfManagedPassword is the password for an externally managed user in the DB.
// If this field is supplied, a DB connection is retrieved from the static
// account cache for the particular DB plugin and used to update the password of
// the self-managed static role.
// *ENTERPRISE-ONLY*
SelfManagedPassword string
}

// ChangePublicKey of a given user
Expand Down
18 changes: 18 additions & 0 deletions sdk/database/helper/connutil/sql_stubs_oss.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0

//go:build !enterprise

package connutil

import (
"context"
"database/sql"
"errors"
)

//go:generate go run github.com/hashicorp/vault/tools/stubmaker

func (c *SQLConnectionProducer) StaticConnection(_ context.Context, _, _ string) (*sql.DB, error) {
return nil, errors.New("self-managed static roles not implemented in CE")
}
Loading