mirror of
				https://github.com/optim-enterprises-bv/vault.git
				synced 2025-10-30 18:17:55 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			28 lines
		
	
	
		
			675 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			28 lines
		
	
	
		
			675 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| package aws
 | |
| 
 | |
| import (
 | |
| 	"context"
 | |
| 	"fmt"
 | |
| 
 | |
| 	"github.com/hashicorp/vault/sdk/framework"
 | |
| 	"github.com/hashicorp/vault/sdk/helper/consts"
 | |
| 	"github.com/hashicorp/vault/sdk/logical"
 | |
| )
 | |
| 
 | |
| func (b *backend) walRollback(ctx context.Context, req *logical.Request, kind string, data interface{}) error {
 | |
| 	walRollbackMap := map[string]framework.WALRollbackFunc{
 | |
| 		"user": b.pathUserRollback,
 | |
| 	}
 | |
| 
 | |
| 	if !b.System().LocalMount() && b.System().ReplicationState().HasState(consts.ReplicationPerformanceSecondary|consts.ReplicationPerformanceStandby) {
 | |
| 		return nil
 | |
| 	}
 | |
| 
 | |
| 	f, ok := walRollbackMap[kind]
 | |
| 	if !ok {
 | |
| 		return fmt.Errorf("unknown type to rollback")
 | |
| 	}
 | |
| 
 | |
| 	return f(ctx, req, kind, data)
 | |
| }
 | 
