Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
6ecc0c2
add utoipa dependencies
Jul 4, 2024
5388389
feat: init openapi to describe /api/v1/user
cpprian Jul 4, 2024
7c49078
nest /swagger-ui into /api/v1
cpprian Jul 4, 2024
4368148
get json with api details
cpprian Jul 5, 2024
0702fd0
add group section
cpprian Jul 5, 2024
72fa738
add api description for enrollment
cpprian Jul 8, 2024
3b1a30c
update description of start_enrollment, start_remote_desktop_configurโ€ฆ
cpprian Jul 8, 2024
fd62044
add description of update and delete user api
cpprian Jul 8, 2024
ba122a0
add description of change_self_password, change_password and reset_paโ€ฆ
cpprian Jul 8, 2024
4d9386f
add description of wallet challenge, updatte wallet, delete wallet anโ€ฆ
cpprian Jul 8, 2024
2048a64
add description of delete_authorized_app, delete_security_key, me endโ€ฆ
cpprian Jul 8, 2024
b1c64a2
fix typo in path to delete_security_key
cpprian Jul 8, 2024
2d12c81
add status code 500 description to few endpoints
cpprian Jul 8, 2024
12902d6
return .env vars to default
cpprian Jul 8, 2024
f2295ee
update comment for not misunderstanding
cpprian Jul 8, 2024
e75b06d
fix rustfmt format errors
cpprian Jul 8, 2024
145cf9b
Merge branch 'dev' into docs-for-rest-api
cpprian Jul 8, 2024
245a298
add tags
cpprian Jul 9, 2024
20b51d8
Merge branch 'docs-for-rest-api' of github.com:DefGuard/defguard intoโ€ฆ
cpprian Jul 9, 2024
b611153
add full description to /user endpoints part 1
cpprian Jul 9, 2024
45c465a
add full description to /user endpoints part 2
cpprian Jul 10, 2024
fc6be3f
update .env and delete pnpm-lock.yaml
cpprian Jul 10, 2024
0bf935a
fix rust fmt errors
cpprian Jul 10, 2024
a78c0f2
Apply suggestions from code review
cpprian Jul 10, 2024
4078b8e
add description of /device endpoints
cpprian Jul 10, 2024
05babb3
describe tag wireguard
cpprian Jul 10, 2024
5a31040
add description of /group endpoints
cpprian Jul 10, 2024
23e9f70
add swagger-ui lib
cpprian Jul 10, 2024
b5c607a
rename endpoint
cpprian Jul 10, 2024
6cba5e6
Apply suggestions from code review
cpprian Jul 11, 2024
7ac661e
change name of the wireguard tag to device
cpprian Jul 12, 2024
7e3f89c
Merge branch 'docs-for-rest-api' of github.com:DefGuard/defguard intoโ€ฆ
cpprian Jul 12, 2024
2726f5a
Merge branch 'dev' into docs-for-rest-api
cpprian Jul 12, 2024
31a7850
Apply suggestions from code review #2
cpprian Jul 12, 2024
0891f90
fix params, requests and imports
t-aleksander Jul 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
227 changes: 223 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ webauthn-rs-proto = "0.5"
x25519-dalek = { version = "2.0", features = ["static_secrets"] }
# openapi
utoipa = { version = "4", features = ["axum_extras"] }
utoipa-swagger-ui = { version = "7", features = ["axum"] }

[dev-dependencies]
bytes = "1.6"
Expand Down
6 changes: 3 additions & 3 deletions src/db/models/device.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ pub struct DeviceConfig {
pub(crate) keepalive_interval: i32,
}

#[derive(Clone, Deserialize, Model, Serialize, Debug)]
#[derive(Clone, Deserialize, Model, Serialize, Debug, ToSchema)]
pub struct Device {
pub id: Option<i64>,
pub name: String,
Expand Down Expand Up @@ -176,13 +176,13 @@ pub struct WireguardNetworkDevice {
pub authorized_at: Option<NaiveDateTime>,
}

#[derive(Serialize, Deserialize, Debug)]
#[derive(Serialize, Deserialize, Debug, ToSchema)]
pub struct AddDevice {
pub name: String,
pub wireguard_pubkey: String,
}

#[derive(Deserialize, Debug)]
#[derive(Deserialize, Debug, ToSchema)]
pub struct ModifyDevice {
pub name: String,
pub wireguard_pubkey: String,
Expand Down
3 changes: 2 additions & 1 deletion src/db/models/group.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
use model_derive::Model;
use sqlx::{query, query_as, query_scalar, Error as SqlxError, PgConnection, PgExecutor};
use utoipa::ToSchema;

use crate::{
db::{models::error::ModelError, User, WireguardNetwork},
server_config,
};

#[derive(Model, Debug)]
#[derive(Model, Debug, ToSchema)]
pub struct Group {
pub(crate) id: Option<i64>,
pub name: String,
Expand Down
Loading