add opnsense-api requests to bruno

This commit is contained in:
Yuri Tatishchev 2024-12-19 19:17:38 -08:00
parent d526839bfa
commit 589c3f2890
Signed by: CaZzzer
GPG Key ID: E0EBF441EA424369
12 changed files with 176 additions and 6 deletions

View File

@ -1,6 +1,8 @@
vars {
opnsense_key: 33NhXqaJwrWy1T4Qi60GK90RXJuS3PWIYwlwYPnQ8f5YPe/J1q/g6/l4bZ2/kJk71MFhwP+9mr+IiQPi
base: https://opnsense.home
}
vars:secret [
vpn_endpoint,
opnsense_secret
]

View File

@ -0,0 +1,38 @@
meta {
name: Add Client Builder
type: http
seq: 9
}
post {
url: {{base}}/api/wireguard/client/addClientBuilder
body: json
auth: inherit
}
headers {
Content-Type: application/json
}
body:json {
{
"configbuilder": {
"enabled": "1",
"name": "{{clientName}}",
"pubkey": "{{clientPubkey}}",
"psk": "{{psk}}",
"tunneladdress": "{{clientTunnelAddress}}",
"keepalive": "",
"server": "{{serverUuid}}",
"endpoint": "{{vpn_endpoint}}"
}
}
}
vars:pre-request {
clientName: vpgen-test
clientPubkey: BJ5faPVJsDP4CCxNYilmKnwlQXOtXEOJjqIwb4U/CgM=
psk: 0LWopbrISXBNHUxr+WOhCSAg+0hD8j3TLmpyzHkBHCQ=
clientTunnelAddress: 10.18.11.101/32,fd00::1/128
serverUuid: 99f278fb-5b79-4fde-b3d8-afab19f1fc07
}

View File

@ -5,14 +5,13 @@ meta {
}
post {
url: https://opnsense.home/api/wireguard/service/show
url: {{base}}/api/wireguard/service/show
body: json
auth: inherit
}
headers {
Content-Type: application/json
Accept: application/json
}
body:json {
@ -20,9 +19,13 @@ body:json {
"current": 1,
"rowCount": 7,
"sort": {},
"searchPhrase": "",
"searchPhrase": "{{searchPhrase}}",
"type": [
"interface"
]
}
}
vars:pre-request {
searchPhrase:
}

View File

@ -0,0 +1,11 @@
meta {
name: Get Key Pair
type: http
seq: 7
}
get {
url: {{base}}/api/wireguard/server/key_pair
body: none
auth: inherit
}

View File

@ -0,0 +1,11 @@
meta {
name: Get PSK
type: http
seq: 8
}
get {
url: {{base}}/api/wireguard/client/psk
body: none
auth: inherit
}

View File

@ -5,14 +5,13 @@ meta {
}
post {
url: https://opnsense.home/api/wireguard/service/show
url: {{base}}/api/wireguard/service/show
body: json
auth: inherit
}
headers {
Content-Type: application/json
Accept: application/json
}
body:json {
@ -20,9 +19,13 @@ body:json {
"current": 1,
"rowCount": 7,
"sort": {},
"searchPhrase": "",
"searchPhrase": "{{searchPhrase}}",
"type": [
"peer"
]
}
}
vars:pre-request {
searchPhrase:
}

View File

@ -0,0 +1,15 @@
meta {
name: Get Server Info
type: http
seq: 6
}
get {
url: {{base}}/api/wireguard/client/get_server_info/:server_uuid
body: none
auth: inherit
}
params:path {
server_uuid: 8799c789-b6fb-4aa8-9dac-edf18d860340
}

View File

@ -0,0 +1,11 @@
meta {
name: List Servers
type: http
seq: 6
}
get {
url: {{base}}/api/wireguard/client/list_servers
body: none
auth: inherit
}

View File

@ -0,0 +1,11 @@
meta {
name: Reconfigure
type: http
seq: 10
}
post {
url: {{base}}/api/wireguard/service/reconfigure
body: none
auth: inherit
}

View File

@ -0,0 +1,30 @@
meta {
name: Search Client
type: http
seq: 5
}
post {
url: {{base}}/api/wireguard/client/searchClient
body: json
auth: inherit
}
headers {
Content-Type: application/json
}
body:json {
{
"current": 1,
"rowCount": 7,
"sort": {},
"servers": ["{{serverUuid}}"],
"searchPhrase": "{{searchPhrase}}"
}
}
vars:pre-request {
searchPhrase:
serverUuid: 64e1d6ec-980a-463d-8583-c863d8e9852b
}

View File

@ -0,0 +1,28 @@
meta {
name: Search Server
type: http
seq: 4
}
post {
url: {{base}}/api/wireguard/server/searchServer
body: json
auth: inherit
}
headers {
Content-Type: application/json
}
body:json {
{
"current": 1,
"rowCount": 7,
"sort": {},
"searchPhrase": "{{searchPhrase}}"
}
}
vars:pre-request {
searchPhrase:
}

View File

@ -0,0 +1,7 @@
meta {
name: opnsense-api
}
headers {
Accept: application/json
}