mirror of
				https://github.com/optim-enterprises-bv/vault.git
				synced 2025-10-30 18:17:55 +00:00 
			
		
		
		
	plugin/wif: support external plugins (#26384)
* plugin/wif: support external plugins * changelog
This commit is contained in:
		 John-Michael Faircloth
					John-Michael Faircloth
				
			
				
					committed by
					
						 GitHub
						GitHub
					
				
			
			
				
	
			
			
			 GitHub
						GitHub
					
				
			
						parent
						
							e4f9d024c8
						
					
				
				
					commit
					1ee302dfcd
				
			
							
								
								
									
										3
									
								
								changelog/26384.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										3
									
								
								changelog/26384.txt
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,3 @@ | |||||||
|  | ```release-note:bug | ||||||
|  | plugin/wif: fix a bug where the namespace was not set for external plugins using workload identity federation | ||||||
|  | ``` | ||||||
| @@ -421,7 +421,7 @@ func (s *gRPCSystemViewServer) GenerateIdentityToken(ctx context.Context, req *p | |||||||
| 	}) | 	}) | ||||||
| 	if err != nil { | 	if err != nil { | ||||||
| 		return &pb.GenerateIdentityTokenResponse{}, status.Errorf(codes.Internal, | 		return &pb.GenerateIdentityTokenResponse{}, status.Errorf(codes.Internal, | ||||||
| 			"failed to generate plugin identity token") | 			err.Error()) | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	return &pb.GenerateIdentityTokenResponse{ | 	return &pb.GenerateIdentityTokenResponse{ | ||||||
|   | |||||||
| @@ -459,12 +459,17 @@ func (d dynamicSystemView) ClusterID(ctx context.Context) (string, error) { | |||||||
| } | } | ||||||
|  |  | ||||||
| func (d dynamicSystemView) GenerateIdentityToken(ctx context.Context, req *pluginutil.IdentityTokenRequest) (*pluginutil.IdentityTokenResponse, error) { | func (d dynamicSystemView) GenerateIdentityToken(ctx context.Context, req *pluginutil.IdentityTokenRequest) (*pluginutil.IdentityTokenResponse, error) { | ||||||
| 	storage := d.core.router.MatchingStorageByAPIPath(ctx, mountPathIdentity) | 	mountEntry := d.mountEntry | ||||||
|  | 	if mountEntry == nil { | ||||||
|  | 		return nil, fmt.Errorf("no mount entry") | ||||||
|  | 	} | ||||||
|  | 	nsCtx := namespace.ContextWithNamespace(ctx, mountEntry.Namespace()) | ||||||
|  | 	storage := d.core.router.MatchingStorageByAPIPath(nsCtx, mountPathIdentity) | ||||||
| 	if storage == nil { | 	if storage == nil { | ||||||
| 		return nil, fmt.Errorf("failed to find storage entry for identity mount") | 		return nil, fmt.Errorf("failed to find storage entry for identity mount") | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	token, ttl, err := d.core.IdentityStore().generatePluginIdentityToken(ctx, storage, d.mountEntry, req.Audience, req.TTL) | 	token, ttl, err := d.core.IdentityStore().generatePluginIdentityToken(nsCtx, storage, d.mountEntry, req.Audience, req.TTL) | ||||||
| 	if err != nil { | 	if err != nil { | ||||||
| 		return nil, fmt.Errorf("failed to generate plugin identity token: %w", err) | 		return nil, fmt.Errorf("failed to generate plugin identity token: %w", err) | ||||||
| 	} | 	} | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user