mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-09-17 21:10:28 +00:00
This commit is contained in:
parent
aa81ceab1a
commit
42f91b0699
@ -24,6 +24,7 @@ import io.swagger.v3.oas.annotations.responses.ApiResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.Max;
|
||||
import javax.validation.constraints.Min;
|
||||
import javax.ws.rs.Consumes;
|
||||
@ -127,7 +128,7 @@ public class BotsResource extends EntityResource<Bots, BotsRepository> {
|
||||
content = @Content(mediaType = "application/json", schema = @Schema(implementation = Bots.class))),
|
||||
@ApiResponse(responseCode = "400", description = "Bad request")
|
||||
})
|
||||
public Response create(@Context UriInfo uriInfo, @Context SecurityContext securityContext, Bots bot)
|
||||
public Response create(@Context UriInfo uriInfo, @Context SecurityContext securityContext, @Valid Bots bot)
|
||||
throws IOException {
|
||||
bot.withId(UUID.randomUUID())
|
||||
.withUpdatedBy(securityContext.getUserPrincipal().getName())
|
||||
|
@ -395,7 +395,7 @@ public class TableResource extends EntityResource<Table, TableRepository> {
|
||||
@Context UriInfo uriInfo,
|
||||
@Context SecurityContext securityContext,
|
||||
@Parameter(description = "Id of the table", schema = @Schema(type = "string")) @PathParam("id") String id,
|
||||
TableJoins joins)
|
||||
@Valid TableJoins joins)
|
||||
throws IOException {
|
||||
SecurityUtil.authorizeAdmin(authorizer, securityContext, ADMIN | BOT);
|
||||
Table table = dao.addJoins(UUID.fromString(id), joins);
|
||||
@ -409,7 +409,7 @@ public class TableResource extends EntityResource<Table, TableRepository> {
|
||||
@Context UriInfo uriInfo,
|
||||
@Context SecurityContext securityContext,
|
||||
@Parameter(description = "Id of the table", schema = @Schema(type = "string")) @PathParam("id") String id,
|
||||
TableData tableData)
|
||||
@Valid TableData tableData)
|
||||
throws IOException {
|
||||
SecurityUtil.authorizeAdmin(authorizer, securityContext, ADMIN | BOT);
|
||||
Table table = dao.addSampleData(UUID.fromString(id), tableData);
|
||||
@ -423,7 +423,7 @@ public class TableResource extends EntityResource<Table, TableRepository> {
|
||||
@Context UriInfo uriInfo,
|
||||
@Context SecurityContext securityContext,
|
||||
@Parameter(description = "Id of the table", schema = @Schema(type = "string")) @PathParam("id") String id,
|
||||
TableProfile tableProfile)
|
||||
@Valid TableProfile tableProfile)
|
||||
throws IOException {
|
||||
SecurityUtil.authorizeAdmin(authorizer, securityContext, ADMIN | BOT);
|
||||
Table table = dao.addTableProfileData(UUID.fromString(id), tableProfile);
|
||||
@ -457,7 +457,7 @@ public class TableResource extends EntityResource<Table, TableRepository> {
|
||||
@Context UriInfo uriInfo,
|
||||
@Context SecurityContext securityContext,
|
||||
@Parameter(description = "Id of the table", schema = @Schema(type = "string")) @PathParam("id") String id,
|
||||
SQLQuery sqlQuery)
|
||||
@Valid SQLQuery sqlQuery)
|
||||
throws IOException {
|
||||
SecurityUtil.authorizeAdmin(authorizer, securityContext, ADMIN | BOT);
|
||||
Table table = dao.addQuery(UUID.fromString(id), sqlQuery);
|
||||
@ -474,7 +474,7 @@ public class TableResource extends EntityResource<Table, TableRepository> {
|
||||
@Context UriInfo uriInfo,
|
||||
@Context SecurityContext securityContext,
|
||||
@Parameter(description = "Id of the table", schema = @Schema(type = "string")) @PathParam("id") String id,
|
||||
DataModel dataModel)
|
||||
@Valid DataModel dataModel)
|
||||
throws IOException {
|
||||
SecurityUtil.authorizeAdmin(authorizer, securityContext, ADMIN | BOT);
|
||||
Table table = dao.addDataModel(UUID.fromString(id), dataModel);
|
||||
@ -488,7 +488,7 @@ public class TableResource extends EntityResource<Table, TableRepository> {
|
||||
@Context UriInfo uriInfo,
|
||||
@Context SecurityContext securityContext,
|
||||
@Parameter(description = "Id of the table", schema = @Schema(type = "string")) @PathParam("id") String id,
|
||||
CreateTableTest createTableTest)
|
||||
@Valid CreateTableTest createTableTest)
|
||||
throws IOException {
|
||||
SecurityUtil.authorizeAdmin(authorizer, securityContext, ADMIN | BOT);
|
||||
TableTest tableTest = getTableTest(securityContext, createTableTest);
|
||||
@ -518,7 +518,7 @@ public class TableResource extends EntityResource<Table, TableRepository> {
|
||||
@Context UriInfo uriInfo,
|
||||
@Context SecurityContext securityContext,
|
||||
@Parameter(description = "Id of the table", schema = @Schema(type = "string")) @PathParam("id") String id,
|
||||
CreateColumnTest createColumnTest)
|
||||
@Valid CreateColumnTest createColumnTest)
|
||||
throws IOException {
|
||||
SecurityUtil.authorizeAdmin(authorizer, securityContext, ADMIN | BOT);
|
||||
ColumnTest columnTest = getColumnTest(securityContext, createColumnTest);
|
||||
@ -533,7 +533,7 @@ public class TableResource extends EntityResource<Table, TableRepository> {
|
||||
@Context UriInfo uriInfo,
|
||||
@Context SecurityContext securityContext,
|
||||
@Parameter(description = "Id of the table", schema = @Schema(type = "string")) @PathParam("id") String id,
|
||||
CreateCustomMetric createCustomMetric)
|
||||
@Valid CreateCustomMetric createCustomMetric)
|
||||
throws IOException {
|
||||
SecurityUtil.authorizeAdmin(authorizer, securityContext, ADMIN | BOT);
|
||||
CustomMetric customMetric = getCustomMetric(securityContext, createCustomMetric);
|
||||
|
@ -344,7 +344,7 @@ public class PipelineResource extends EntityResource<Pipeline, PipelineRepositor
|
||||
@Context UriInfo uriInfo,
|
||||
@Context SecurityContext securityContext,
|
||||
@Parameter(description = "Id of the pipeline", schema = @Schema(type = "string")) @PathParam("id") String id,
|
||||
PipelineStatus pipelineStatus)
|
||||
@Valid PipelineStatus pipelineStatus)
|
||||
throws IOException {
|
||||
SecurityUtil.authorizeAdmin(authorizer, securityContext, ADMIN | BOT);
|
||||
Pipeline pipeline = dao.addPipelineStatus(UUID.fromString(id), pipelineStatus);
|
||||
|
Loading…
x
Reference in New Issue
Block a user