mirror of
				https://github.com/optim-enterprises-bv/vault.git
				synced 2025-10-31 10:37:56 +00:00 
			
		
		
		
	VAULT-25883: Fix namespace errors with path filters on sys/internal/ui/mounts (#27939)
* include namespace in prefix fopr sys/internal/ui/mounts * changelog
This commit is contained in:
		
							
								
								
									
										3
									
								
								changelog/27939.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								changelog/27939.txt
									
									
									
									
									
										Normal file
									
								
							| @@ -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. | ||||||
|  | ``` | ||||||
| @@ -5075,6 +5075,14 @@ func (b *SystemBackend) pathInternalUIMountRead(ctx context.Context, req *logica | |||||||
| 		routerPrefix = credentialRoutePrefix | 		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) | 	filtered, err := b.Core.checkReplicatedFiltering(ctx, me, routerPrefix) | ||||||
| 	if err != nil { | 	if err != nil { | ||||||
| 		return nil, err | 		return nil, err | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 miagilepner
					miagilepner