Skip to content

Change /global/ to /system/ to reflect RFD-288 #1676

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
12 changes: 6 additions & 6 deletions nexus/src/external_api/http_entrypoints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ type NexusApiDescription = ApiDescription<Arc<ServerContext>>;
/// Returns a description of the external nexus API
pub fn external_api() -> NexusApiDescription {
fn register_endpoints(api: &mut NexusApiDescription) -> Result<(), String> {
api.register(global_policy_view)?;
api.register(global_policy_update)?;
api.register(system_policy_view)?;
api.register(system_policy_update)?;

api.register(policy_view)?;
api.register(policy_update)?;
Expand Down Expand Up @@ -319,10 +319,10 @@ pub fn external_api() -> NexusApiDescription {
/// Fetch the top-level IAM policy
#[endpoint {
method = GET,
path = "/global/policy",
path = "/system/policy",
tags = ["policy"],
}]
async fn global_policy_view(
async fn system_policy_view(
rqctx: Arc<RequestContext<Arc<ServerContext>>>,
) -> Result<HttpResponseOk<shared::Policy<authz::FleetRole>>, HttpError> {
let apictx = rqctx.context();
Expand All @@ -345,10 +345,10 @@ struct ByIdPathParams {
/// Update the top-level IAM policy
#[endpoint {
method = PUT,
path = "/global/policy",
path = "/system/policy",
tags = ["policy"],
}]
async fn global_policy_update(
async fn system_policy_update(
rqctx: Arc<RequestContext<Arc<ServerContext>>>,
new_policy: TypedBody<shared::Policy<authz::FleetRole>>,
) -> Result<HttpResponseOk<shared::Policy<authz::FleetRole>>, HttpError> {
Expand Down
4 changes: 2 additions & 2 deletions nexus/tests/integration_tests/endpoints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ lazy_static! {
format!("/hardware/sleds/{}", SLED_AGENT_UUID);

// Global policy
pub static ref GLOBAL_POLICY_URL: &'static str = "/global/policy";
pub static ref SYSTEM_POLICY_URL: &'static str = "/system/policy";

// Silo used for testing
pub static ref DEMO_SILO_NAME: Name = "demo-silo".parse().unwrap();
Expand Down Expand Up @@ -525,7 +525,7 @@ lazy_static! {
pub static ref VERIFY_ENDPOINTS: Vec<VerifyEndpoint> = vec![
// Global IAM policy
VerifyEndpoint {
url: *GLOBAL_POLICY_URL,
url: *SYSTEM_POLICY_URL,
visibility: Visibility::Public,
unprivileged_access: UnprivilegedAccess::None,
allowed_methods: vec![
Expand Down
2 changes: 1 addition & 1 deletion nexus/tests/integration_tests/role_assignments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ async fn test_role_assignments_fleet(cptestctx: &ControlPlaneTestContext) {
const ROLE: Self::RoleType = authz::FleetRole::Admin;
const VISIBLE_TO_UNPRIVILEGED: bool = true;
fn policy_url(&self) -> String {
String::from("/global/policy")
String::from("/system/policy")
}

fn verify_initial<'a, 'b, 'c, 'd>(
Expand Down
4 changes: 2 additions & 2 deletions nexus/tests/output/nexus_tags.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ organization_view_by_id /by-id/organizations/{id}

API operations found with tag "policy"
OPERATION ID URL PATH
global_policy_update /global/policy
global_policy_view /global/policy
system_policy_update /system/policy
system_policy_view /system/policy

API operations found with tag "projects"
OPERATION ID URL PATH
Expand Down
124 changes: 62 additions & 62 deletions openapi/nexus.json
Original file line number Diff line number Diff line change
Expand Up @@ -569,68 +569,6 @@
}
}
},
"/global/policy": {
"get": {
"tags": [
"policy"
],
"summary": "Fetch the top-level IAM policy",
"operationId": "global_policy_view",
"responses": {
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/FleetRolePolicy"
}
}
}
},
"4XX": {
"$ref": "#/components/responses/Error"
},
"5XX": {
"$ref": "#/components/responses/Error"
}
}
},
"put": {
"tags": [
"policy"
],
"summary": "Update the top-level IAM policy",
"operationId": "global_policy_update",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/FleetRolePolicy"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/FleetRolePolicy"
}
}
}
},
"4XX": {
"$ref": "#/components/responses/Error"
},
"5XX": {
"$ref": "#/components/responses/Error"
}
}
}
},
"/hardware/racks": {
"get": {
"tags": [
Expand Down Expand Up @@ -6837,6 +6775,68 @@
}
}
},
"/system/policy": {
"get": {
"tags": [
"policy"
],
"summary": "Fetch the top-level IAM policy",
"operationId": "system_policy_view",
"responses": {
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/FleetRolePolicy"
}
}
}
},
"4XX": {
"$ref": "#/components/responses/Error"
},
"5XX": {
"$ref": "#/components/responses/Error"
}
}
},
"put": {
"tags": [
"policy"
],
"summary": "Update the top-level IAM policy",
"operationId": "system_policy_update",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/FleetRolePolicy"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "successful operation",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/FleetRolePolicy"
}
}
}
},
"4XX": {
"$ref": "#/components/responses/Error"
},
"5XX": {
"$ref": "#/components/responses/Error"
}
}
}
},
"/system/user": {
"get": {
"tags": [
Expand Down