-
Type:
Task
-
Resolution: Done
-
Priority:
Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: Infrastructure
-
Atlas SQL
-
Not Needed
New ApiPrivateSQLInterfaceStatusResource API to create X509 certificates DB scoped to "sql_interface". With "readWrite" permission to propagate the SQL interface status to user cluster.
Existing similar endpoints for inspirations are:
- generateClusterAccessForRehydrationJob in server/src/main/com/xgen/svc/mms/api/res/atlas/_private/dataLake/ApiPrivateAtlasDataLakeResource.java
- generateX509Access in server/src/main/com/xgen/svc/mms/api/res/atlas/_private/ApiPrivateAtlasRealmResource.java
Our API will have only one endpoint: generateClusterAccessForSQLInterface. The mandatory input are groupId, clusterName, envelope. We might want to also pass in the temporal propagation run ID (we should be able to retrieve it by calling Workflow.getInfo().getRunId() inside the propagation workflow) for better auditing.
The response is ApiPrivateAtlasCompatibleClusterAccessResponseView with the Mesh hostnames, certificate and private key that the client will need to connect.
Stub (draft - might need some tweaking)
@POST @Path("/{groupId}/clusters/{clusterName}/sqlInterface/{propagationJobId}/x509access") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) @RolesAllowed({RoleSet.NAME.GLOBAL_BAAS_X509_CERTIFICATE}) @Auth( endpointAction = "epa.global.ApiPrivateAtlasSQLResource.generateClusterAccessForSQLInterface.POST") public Response generateClusterAccessForSQLInterface( @PathParam("groupId") final ObjectId pGroupId, @PathParam("clusterName") final String pClusterName, @PathParam("propagationJobId") final ObjectId pPropagationJobId, @QueryParam("envelope") final Boolean pEnvelope, final ApiPrivateAtlasCompatibleClusterAccessResponseView pClusterAccessView) {...}