Skip to content

Commit 4d81df6

Browse files
authored
Merge branch 'main' into docs/secrets-seo-updates-3
2 parents a44e3da + ca203c2 commit 4d81df6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+1518
-585
lines changed

.github/workflows/hack-week-benchmark.yml .github/workflows/benchmark-prevent-performance-degradations.yml

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
jobs:
88
bench:
99
name: Bench
10+
if: github.base_ref == 'main'
1011
runs-on: ubuntu-latest
1112
steps:
1213
- name: Check out code into the Go module directory

changelog/29045.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
```release-note:change
2-
secrets/pki: Enforce the issuer constraint extensions (extended key usage, name constraints, issuer name) when issuing or signing leaf certificates.
2+
secrets/pki: Enforce the issuer constraint extensions (extended key usage, name constraints, issuer name) when issuing or signing leaf certificates. For more information see [PKI considerations](https://developer.hashicorp.com/vault/docs/secrets/pki/considerations#issuer-constraints-enforcement)
33
```

changelog/29082.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:improvement
2+
sdk: Add Vault build date to system view plugin environment response
3+
```

changelog/29090.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note:change
2+
core/raft: Return an error on sys/storage/raft/join if a node that has been removed from raft cluster attempts to re-join when it still has existing raft data on disk.
3+
```

changelog/29114.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
```release-note:bug
2-
ui: Decode database url to fix editing failures for an oracle connection
2+
ui: Decode `connection_url` to fix database connection updates (i.e. editing connection config, deleting roles) failing when urls include template variables.
33
```

changelog/29145.txt

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
```release-note:improvement
2+
activity: Add a "local_mount" field to the Export API response. This field is true if the client is a token or created on a
3+
local mount.
4+
```

physical/raft/raft.go

+13-2
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ type RaftBackend struct {
256256
// limits.
257257
specialPathLimits map[string]uint64
258258

259-
removed atomic.Bool
259+
removed *atomic.Bool
260260
removedCallback func()
261261
}
262262

@@ -277,9 +277,11 @@ func (b *RaftBackend) IsRemoved() bool {
277277
return b.removed.Load()
278278
}
279279

280+
var removedKey = []byte("removed")
281+
280282
func (b *RaftBackend) RemoveSelf() error {
281283
b.removed.Store(true)
282-
return nil
284+
return b.stableStore.SetUint64(removedKey, 1)
283285
}
284286

285287
// LeaderJoinInfo contains information required by a node to join itself as a
@@ -593,6 +595,14 @@ func NewRaftBackend(conf map[string]string, logger log.Logger) (physical.Backend
593595
snapStore = newSnapshotStoreDelay(snapStore, backendConfig.SnapshotDelay, logger)
594596
}
595597

598+
isRemoved := new(atomic.Bool)
599+
removedVal, err := stableStore.GetUint64(removedKey)
600+
if err != nil {
601+
logger.Error("error checking if this node is removed. continuing under the assumption that it's not", "error", err)
602+
}
603+
if removedVal == 1 {
604+
isRemoved.Store(true)
605+
}
596606
return &RaftBackend{
597607
logger: logger,
598608
fsm: fsm,
@@ -619,6 +629,7 @@ func NewRaftBackend(conf map[string]string, logger log.Logger) (physical.Backend
619629
raftLogVerifierEnabled: backendConfig.RaftLogVerifierEnabled,
620630
raftLogVerificationInterval: backendConfig.RaftLogVerificationInterval,
621631
effectiveSDKVersion: version.GetVersion().Version,
632+
removed: isRemoved,
622633
}, nil
623634
}
624635

sdk/logical/events.go

+10-3
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,17 @@ import (
1212

1313
// common event metadata keys
1414
const (
15-
// EventMetadataDataPath is used in event metadata to show the API path that can be used to fetch any underlying
16-
// data. For example, the KV plugin would set this to `data/mysecret`. The event system will automatically prepend
17-
// the plugin mount to this path, if present, so it would become `secret/data/mysecret`, for example.
15+
// EventMetadataPath is used in event metadata to show the API path the client must have the `subscribe` capability
16+
// on in order to consume the event. It is recommended that the event path metadata field is the API path that was
17+
// invoked in order to generate the event.
18+
//
19+
// For example, the KV plugin would set this to `data/mysecret`. The event system will automatically prepend the
20+
// plugin mount to this path, if present, so it would become `secret/data/mysecret`, for example.
1821
// If this is an auth plugin event, this will additionally be prepended with `auth/`.
22+
EventMetadataPath = "path"
23+
// EventMetadataDataPath is used in event metadata to show the API path that can be used to fetch any underlying
24+
// data. Similar to the `path` event metadata, the event system will automatically prepend the plugin mount to the
25+
// `data_path`.
1926
EventMetadataDataPath = "data_path"
2027
// EventMetadataOperation is used in event metadata to express what operation was performed that generated the
2128
// event, e.g., `read` or `write`.

sdk/logical/plugin.pb.go

+39-20
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sdk/logical/plugin.proto

+5
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ syntax = "proto3";
55

66
package logical;
77

8+
import "google/protobuf/timestamp.proto";
9+
810
option go_package = "github.com/hashicorp/vault/sdk/logical";
911

1012
message PluginEnvironment {
@@ -16,4 +18,7 @@ message PluginEnvironment {
1618

1719
// VaultVersionMetadata is the version metadata of the Vault server
1820
string vault_version_metadata = 3;
21+
22+
// VaultBuildDate is the build date of the Vault server
23+
google.protobuf.Timestamp vault_build_date = 4;
1924
}

ui/app/adapters/azure/config.js

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/**
2+
* Copyright (c) HashiCorp, Inc.
3+
* SPDX-License-Identifier: BUSL-1.1
4+
*/
5+
6+
import ApplicationAdapter from '../application';
7+
import { encodePath } from 'vault/utils/path-encoding-helpers';
8+
9+
export default class AzureConfig extends ApplicationAdapter {
10+
namespace = 'v1';
11+
12+
_url(backend) {
13+
return `${this.buildURL()}/${encodePath(backend)}/config`;
14+
}
15+
16+
queryRecord(store, type, query) {
17+
const { backend } = query;
18+
return this.ajax(this._url(backend), 'GET').then((resp) => {
19+
return {
20+
...resp,
21+
id: backend,
22+
backend,
23+
};
24+
});
25+
}
26+
}

ui/app/components/secret-engine/configuration-details.hbs

+31-36
Original file line numberDiff line numberDiff line change
@@ -3,47 +3,42 @@
33
SPDX-License-Identifier: BUSL-1.1
44
~}}
55

6-
{{#if @configModels.length}}
7-
{{#each @configModels as |configModel|}}
8-
{{#each configModel.attrs as |attr|}}
9-
{{! public key while not sensitive when editing/creating, should be hidden by default on viewing }}
10-
{{#if (or attr.options.sensitive (eq attr.name "publicKey"))}}
11-
<InfoTableRow
12-
alwaysRender={{not (is-empty-value (get configModel attr.name))}}
13-
@label={{or attr.options.label (to-label attr.name)}}
14-
@value={{get configModel (or attr.options.fieldValue attr.name)}}
15-
>
16-
{{#if (or attr.options.sensitive (eq attr.name "publicKey"))}}
17-
<MaskedInput
18-
@value={{get configModel attr.name}}
19-
@name={{attr.name}}
20-
@displayOnly={{true}}
21-
@allowCopy={{true}}
22-
/>
23-
{{/if}}
24-
</InfoTableRow>
25-
{{else}}
26-
<InfoTableRow
27-
@alwaysRender={{not (is-empty-value (get @model attr.name))}}
28-
@label={{or attr.options.label (to-label attr.name)}}
29-
@value={{get configModel (or attr.options.fieldValue attr.name)}}
30-
/>
31-
{{/if}}
32-
{{/each}}
6+
{{#each @configModels as |configModel|}}
7+
{{#each configModel.displayAttrs as |attr|}}
8+
{{! public key while not sensitive when editing/creating, should be hidden by default on viewing }}
9+
{{#if (or attr.options.sensitive (eq attr.name "publicKey"))}}
10+
<InfoTableRow
11+
alwaysRender={{not (is-empty-value (get configModel attr.name))}}
12+
@label={{or attr.options.label (to-label attr.name)}}
13+
@value={{get configModel (or attr.options.fieldValue attr.name)}}
14+
>
15+
<MaskedInput @value={{get configModel attr.name}} @name={{attr.name}} @displayOnly={{true}} @allowCopy={{true}} />
16+
</InfoTableRow>
17+
{{else}}
18+
<InfoTableRow
19+
@alwaysRender={{not (is-empty-value (get @model attr.name))}}
20+
@label={{or attr.options.label (to-label attr.name)}}
21+
@value={{get configModel (or attr.options.fieldValue attr.name)}}
22+
@formatTtl={{eq attr.options.editType "ttl"}}
23+
/>
24+
{{/if}}
3325
{{/each}}
3426
{{else}}
3527
{{! Prompt user to configure the secret engine }}
3628
<EmptyState
3729
data-test-config-cta
3830
@title="{{@typeDisplay}} not configured"
39-
@message="Get started by configuring your {{@typeDisplay}} engine."
31+
@message="Get started by configuring your {{@typeDisplay}} secrets engine."
4032
>
41-
<Hds::Link::Standalone
42-
@icon="chevron-right"
43-
@iconPosition="trailing"
44-
@text="Configure {{@typeDisplay}}"
45-
@route="vault.cluster.secrets.backend.configuration.edit"
46-
@model={{@id}}
47-
/>
33+
{{! TODO: short-term conditional to be removed once configuration for azure is merged. }}
34+
{{#unless (eq @typeDisplay "Azure")}}
35+
<Hds::Link::Standalone
36+
@icon="chevron-right"
37+
@iconPosition="trailing"
38+
@text="Configure {{@typeDisplay}}"
39+
@route="vault.cluster.secrets.backend.configuration.edit"
40+
@model={{@id}}
41+
/>
42+
{{/unless}}
4843
</EmptyState>
49-
{{/if}}
44+
{{/each}}

ui/app/components/secret-engine/configure-aws.hbs

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
{{/if}}
5757
{{#if (eq this.accessType "wif")}}
5858
{{! WIF Fields }}
59-
{{#each @issuerConfig.attrs as |attr|}}
59+
{{#each @issuerConfig.displayAttrs as |attr|}}
6060
<FormField @attr={{attr}} @model={{@issuerConfig}} />
6161
{{/each}}
6262
<FormFieldGroups
@@ -82,7 +82,7 @@
8282
Leases
8383
</h2>
8484
<div class="box is-fullwidth is-sideless is-bottomless">
85-
{{#each @leaseConfig.attrs as |attr|}}
85+
{{#each @leaseConfig.displayAttrs as |attr|}}
8686
<FormField @attr={{attr}} @model={{@leaseConfig}} @modelValidations={{this.modelValidationsLease}} />
8787
{{/each}}
8888
</div>

ui/app/helpers/mountable-secret-engines.js

+15-6
Original file line numberDiff line numberDiff line change
@@ -135,23 +135,32 @@ const MOUNTABLE_SECRET_ENGINES = [
135135
];
136136

137137
// A list of Workload Identity Federation engines.
138-
// Will eventually include Azure and GCP.
139-
export const WIF_ENGINES = ['aws'];
138+
export const WIF_ENGINES = ['aws', 'azure'];
140139

141140
export function wifEngines() {
142141
return WIF_ENGINES.slice();
143142
}
144143

144+
// The UI only supports configuration views for these secrets engines. The CLI must be used to manage other engine resources (i.e. roles, credentials).
145+
// Will eventually include gcp.
146+
export const CONFIGURATION_ONLY = ['azure'];
147+
148+
export function configurationOnly() {
149+
return CONFIGURATION_ONLY.slice();
150+
}
151+
145152
// Secret engines that have their own configuration page and actions
146153
// These engines do not exist in their own Ember engine.
147-
export const CONFIGURABLE_SECRET_ENGINES = ['aws', 'ssh'];
154+
export const CONFIGURABLE_SECRET_ENGINES = ['aws', 'azure', 'ssh'];
148155

149-
export function configurableSecretEngines() {
156+
export function mountableEngines() {
150157
return MOUNTABLE_SECRET_ENGINES.slice();
151158
}
159+
// secret engines that have not other views than the mount view and mount details view
160+
export const UNSUPPORTED_ENGINES = ['alicloud', 'consul', 'gcp', 'gcpkms', 'nomad', 'rabbitmq', 'totp'];
152161

153-
export function mountableEngines() {
154-
return MOUNTABLE_SECRET_ENGINES.slice();
162+
export function unsupportedEngines() {
163+
return UNSUPPORTED_ENGINES.slice();
155164
}
156165

157166
export function allEngines() {

ui/app/helpers/supported-secret-backends.js

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { helper as buildHelper } from '@ember/component/helper';
77

88
const SUPPORTED_SECRET_BACKENDS = [
99
'aws',
10+
'azure',
1011
'cubbyhole',
1112
'database',
1213
'generic',

ui/app/models/aws/lease-config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export default class AwsLeaseConfig extends Model {
3232
})
3333
lease;
3434

35-
get attrs() {
35+
get displayAttrs() {
3636
const keys = ['lease', 'leaseMax'];
3737
return expandAttributeMeta(this, keys);
3838
}

ui/app/models/aws/root-config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export default class AwsRootConfig extends Model {
5050
})
5151
maxRetries;
5252

53-
get attrs() {
53+
get displayAttrs() {
5454
const keys = [
5555
'roleArn',
5656
'identityTokenAudience',

0 commit comments

Comments
 (0)