Skip to content

Commit

Permalink
backport of commit 2d1c3db (#27951)
Browse files Browse the repository at this point in the history
Co-authored-by: miagilepner <[email protected]>
  • Loading branch information
1 parent f502e1e commit f4a3ac4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions changelog/27939.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
core (enterprise): Fix 500 errors that occurred querying `sys/internal/ui/mounts` for a mount prefixed by a namespace path when path filters are configured.
```
8 changes: 8 additions & 0 deletions vault/logical_system.go
Original file line number Diff line number Diff line change
Expand Up @@ -5074,6 +5074,14 @@ func (b *SystemBackend) pathInternalUIMountRead(ctx context.Context, req *logica
routerPrefix = credentialRoutePrefix
}

// the mount's namespace is (at least partially) in the request path and not
// in the request's context, so we need to add the namespace from the
// request path to the router prefix
if me.NamespaceID != ns.ID {
namespaceRouterPrefix := strings.TrimPrefix(me.Namespace().Path, ns.Path)
routerPrefix = namespaceRouterPrefix + routerPrefix
}

filtered, err := b.Core.checkReplicatedFiltering(ctx, me, routerPrefix)
if err != nil {
return nil, err
Expand Down

0 comments on commit f4a3ac4

Please sign in to comment.