Skip to content

Commit

Permalink
Merge pull request #2747 from Krishanx92/gonew
Browse files Browse the repository at this point in the history
Remove auth from config deployer
  • Loading branch information
Krishanx92 authored Feb 1, 2025
2 parents 723a274 + 3c8ec21 commit 71b6373
Showing 1 changed file with 28 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,20 @@ isolated service http:InterceptableService /api/deployer on ep0 {
# InternalServerErrorError (Internal Server Error.)
isolated resource function post apis/deploy(http:RequestContext requestContext, http:Request request) returns commons:APKError|http:Response {
DeployerClient deployerClient = new;
commons:UserContext authenticatedUserContext = check commons:getAuthenticatedUserContext(requestContext);
commons:Organization organization = authenticatedUserContext.organization;
// commons:UserContext authenticatedUserContext = check commons:getAuthenticatedUserContext(requestContext);
// commons:Organization organization = authenticatedUserContext.organization;
commons:Organization organization = {
uuid: "123e4567-e89b-12d3-a456-426614174000",
name: "default",
displayName: "Example Corporation",
organizationClaimValue: "example-claim",
enabled: true,
serviceListingNamespaces: ["namespace1", "namespace2"], // Override default
properties: [
{ key: "region", value: "US" },
{ key: "type", value: "Enterprise" }
]
};
return check deployerClient.handleAPIDeployment(request, organization);
}
# Undeploy API
Expand All @@ -26,8 +38,20 @@ isolated service http:InterceptableService /api/deployer on ep0 {
# InternalServerErrorError (Internal Server Error.)
isolated resource function post apis/undeploy(http:RequestContext requestContext, string apiId) returns AcceptedString|BadRequestError|InternalServerErrorError|commons:APKError {
DeployerClient deployerClient = new;
commons:UserContext authenticatedUserContext = check commons:getAuthenticatedUserContext(requestContext);
commons:Organization organization = authenticatedUserContext.organization;
// commons:UserContext authenticatedUserContext = check commons:getAuthenticatedUserContext(requestContext);
// commons:Organization organization = authenticatedUserContext.organization;
commons:Organization organization = {
uuid: "123e4567-e89b-12d3-a456-426614174000",
name: "default",
displayName: "Example Corporation",
organizationClaimValue: "example-claim",
enabled: true,
serviceListingNamespaces: ["namespace1", "namespace2"], // Override default
properties: [
{ key: "region", value: "US" },
{ key: "type", value: "Enterprise" }
]
};
return check deployerClient.handleAPIUndeployment(apiId, organization);
}

Expand Down

0 comments on commit 71b6373

Please sign in to comment.