mirror of
				https://github.com/optim-enterprises-bv/vault.git
				synced 2025-10-31 18:48:08 +00:00 
			
		
		
		
	events: Add websockets and command (#19057)
Also updates the event receieved to include a timestamp.
Websockets support both JSON and protobuf binary formats.
This can be used by either `wscat` or the new
`vault events subscribe`:
e.g.,
```sh
$ wscat -H "X-Vault-Token: $(vault print token)" --connect ws://127.0.0.1:8200/v1/sys/events/subscribe/abc?json=true
{"event":{"id":"5c5c8c83-bf43-7da5-fe88-fc3cac814b2e", "note":"testing"}, "eventType":"abc", "timestamp":"2023-02-07T18:40:50.598408Z"}
...
```
and
```sh
$ vault events subscribe abc
{"event":{"id":"5c5c8c83-bf43-7da5-fe88-fc3cac814b2e", "note":"testing"}, "eventType":"abc", "timestamp":"2023-02-07T18:40:50.598408Z"}
...
```
Co-authored-by: Tom Proctor <tomhjp@users.noreply.github.com>
			
			
This commit is contained in:
		 Christopher Swenson
					Christopher Swenson
				
			
				
					committed by
					
						 GitHub
						GitHub
					
				
			
			
				
	
			
			
			 GitHub
						GitHub
					
				
			
						parent
						
							2685dd02e2
						
					
				
				
					commit
					6e233e567b
				
			| @@ -332,6 +332,11 @@ func initCommands(ui, serverCmdUi cli.Ui, runOpts *RunOptions) map[string]cli.Co | ||||
| 				BaseCommand: getBaseCommand(), | ||||
| 			}, nil | ||||
| 		}, | ||||
| 		"events subscribe": func() (cli.Command, error) { | ||||
| 			return &EventsSubscribeCommands{ | ||||
| 				BaseCommand: getBaseCommand(), | ||||
| 			}, nil | ||||
| 		}, | ||||
| 		"lease": func() (cli.Command, error) { | ||||
| 			return &LeaseCommand{ | ||||
| 				BaseCommand: getBaseCommand(), | ||||
|   | ||||
		Reference in New Issue
	
	Block a user