Skip to content

Commit

Permalink
working
Browse files Browse the repository at this point in the history
  • Loading branch information
ahl committed Jul 3, 2022
1 parent fa0ff0d commit 2c7e870
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 106 deletions.
8 changes: 5 additions & 3 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion nexus/src/db/datastore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2305,7 +2305,7 @@ impl DataStore {
};
sled_client_types::NetworkInterface {
name: sled_client_types::Name::from(&nic.name.0),
ip: nic.ip.ip().to_string(),
ip: nic.ip.ip(),
mac: sled_client_types::MacAddr::from(nic.mac.0),
subnet: sled_client_types::IpNet::from(ip_subnet),
vni: sled_client_types::Vni::from(nic.vni.0),
Expand Down
2 changes: 1 addition & 1 deletion nexus/src/db/model/external_ip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ pub struct InstanceExternalIp {
impl From<InstanceExternalIp> for sled_agent_client::types::ExternalIp {
fn from(eip: InstanceExternalIp) -> Self {
Self {
ip: eip.ip.ip().to_string(),
ip: eip.ip.ip(),
first_port: eip.first_port.0,
last_port: eip.last_port.0,
}
Expand Down
2 changes: 1 addition & 1 deletion nexus/src/external_api/device_auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ pub enum DeviceAccessTokenResponse {
method = POST,
path = "/device/token",
content_type = "application/x-www-form-urlencoded",
tags = ["hidden"], // "token"
unpublished = true,
}]
pub async fn device_access_token(
rqctx: Arc<RequestContext<Arc<ServerContext>>>,
Expand Down
2 changes: 0 additions & 2 deletions nexus/tests/output/nexus_tags.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ vpc_firewall_rules_put /organizations/{organization_name}/proj

API operations found with tag "hidden"
OPERATION ID URL PATH
device_access_token /device/token
device_auth_confirm /device/confirm
device_auth_request /device/auth
device_auth_verify /device/verify
logout /logout
session_me /session/me
Expand Down
92 changes: 0 additions & 92 deletions openapi/nexus.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,36 +10,6 @@
"version": "0.0.1"
},
"paths": {
"/device/auth": {
"post": {
"tags": [
"hidden"
],
"summary": "Start an OAuth 2.0 Device Authorization Grant",
"description": "This endpoint is designed to be accessed from an *unauthenticated* API client. It generates and records a `device_code` and `user_code` which must be verified and confirmed prior to a token being granted.",
"operationId": "device_auth_request",
"requestBody": {
"content": {
"application/x-www-form-urlencoded": {
"schema": {
"$ref": "#/components/schemas/DeviceAuthRequest"
}
}
},
"required": true
},
"responses": {
"default": {
"description": "",
"content": {
"*/*": {
"schema": {}
}
}
}
}
}
},
"/device/confirm": {
"post": {
"tags": [
Expand Down Expand Up @@ -82,36 +52,6 @@
}
}
},
"/device/token": {
"post": {
"tags": [
"hidden"
],
"summary": "Request a device access token",
"description": "This endpoint should be polled by the client until the user code is verified and the grant is confirmed.",
"operationId": "device_access_token",
"requestBody": {
"content": {
"application/x-www-form-urlencoded": {
"schema": {
"$ref": "#/components/schemas/DeviceAccessTokenRequest"
}
}
},
"required": true
},
"responses": {
"default": {
"description": "",
"content": {
"*/*": {
"schema": {}
}
}
}
}
}
},
"/device/verify": {
"get": {
"tags": [
Expand Down Expand Up @@ -6273,38 +6213,6 @@
"public_cert"
]
},
"DeviceAccessTokenRequest": {
"type": "object",
"properties": {
"client_id": {
"type": "string",
"format": "uuid"
},
"device_code": {
"type": "string"
},
"grant_type": {
"type": "string"
}
},
"required": [
"client_id",
"device_code",
"grant_type"
]
},
"DeviceAuthRequest": {
"type": "object",
"properties": {
"client_id": {
"type": "string",
"format": "uuid"
}
},
"required": [
"client_id"
]
},
"DeviceAuthVerify": {
"type": "object",
"properties": {
Expand Down
3 changes: 2 additions & 1 deletion oxide-client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ license = "MPL-2.0"

[dependencies]
progenitor = { git = "https://github.com/oxidecomputer/progenitor" }
#serde_json = "1.0"
futures = "0.3.21"
serde_json = "1.0.82"

[dependencies.chrono]
version = "0.4"
Expand Down
10 changes: 5 additions & 5 deletions oxide-client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

//! Interface for making API requests to the Oxide control plane.
// progenitor::generate_api!(
// spec = "../openapi/nexus.json",
// interface = Builder,
// tags = Separate,
// );
progenitor::generate_api!(
spec = "../openapi/nexus.json",
interface = Builder,
tags = Separate,
);

0 comments on commit 2c7e870

Please sign in to comment.