diff --git a/api/swagger/docs.go b/api/swagger/docs.go index b1c8289d..8f7319ef 100644 --- a/api/swagger/docs.go +++ b/api/swagger/docs.go @@ -11266,12 +11266,21 @@ const docTemplate = `{ }, "github_com_openinfradev_tks-api_pkg_domain.CreatePolicyRequest": { "type": "object", + "required": [ + "enforcementAction", + "policyName" + ], "properties": { "description": { "type": "string" }, "enforcementAction": { "type": "string", + "enum": [ + "deny", + "dryrun", + "warn" + ], "example": "deny" }, "mandatory": { @@ -11333,7 +11342,9 @@ const docTemplate = `{ "type": "object", "required": [ "kind", - "rego" + "rego", + "severity", + "templateName" ], "properties": { "deprecated": { @@ -15068,12 +15079,22 @@ const docTemplate = `{ }, "github_com_openinfradev_tks-api_pkg_domain.UpdatePolicyRequest": { "type": "object", + "required": [ + "enforcementAction", + "policyName" + ], "properties": { "description": { "type": "string" }, "enforcementAction": { - "type": "string" + "type": "string", + "enum": [ + "deny", + "dryrun", + "warn" + ], + "example": "deny" }, "mandatory": { "type": "boolean" @@ -15110,6 +15131,9 @@ const docTemplate = `{ }, "github_com_openinfradev_tks-api_pkg_domain.UpdatePolicyTemplateRequest": { "type": "object", + "required": [ + "templateName" + ], "properties": { "deprecated": { "type": "boolean", @@ -15633,7 +15657,9 @@ const docTemplate = `{ "type": "object", "required": [ "kind", - "rego" + "rego", + "severity", + "templateName" ], "properties": { "deprecated": { @@ -15987,6 +16013,9 @@ const docTemplate = `{ }, "github_com_openinfradev_tks-api_pkg_domain_admin.UpdatePolicyTemplateRequest": { "type": "object", + "required": [ + "templateName" + ], "properties": { "deprecated": { "type": "boolean", diff --git a/api/swagger/swagger.json b/api/swagger/swagger.json index c33a4906..05a152bd 100644 --- a/api/swagger/swagger.json +++ b/api/swagger/swagger.json @@ -11260,12 +11260,21 @@ }, "github_com_openinfradev_tks-api_pkg_domain.CreatePolicyRequest": { "type": "object", + "required": [ + "enforcementAction", + "policyName" + ], "properties": { "description": { "type": "string" }, "enforcementAction": { "type": "string", + "enum": [ + "deny", + "dryrun", + "warn" + ], "example": "deny" }, "mandatory": { @@ -11327,7 +11336,9 @@ "type": "object", "required": [ "kind", - "rego" + "rego", + "severity", + "templateName" ], "properties": { "deprecated": { @@ -15062,12 +15073,22 @@ }, "github_com_openinfradev_tks-api_pkg_domain.UpdatePolicyRequest": { "type": "object", + "required": [ + "enforcementAction", + "policyName" + ], "properties": { "description": { "type": "string" }, "enforcementAction": { - "type": "string" + "type": "string", + "enum": [ + "deny", + "dryrun", + "warn" + ], + "example": "deny" }, "mandatory": { "type": "boolean" @@ -15104,6 +15125,9 @@ }, "github_com_openinfradev_tks-api_pkg_domain.UpdatePolicyTemplateRequest": { "type": "object", + "required": [ + "templateName" + ], "properties": { "deprecated": { "type": "boolean", @@ -15627,7 +15651,9 @@ "type": "object", "required": [ "kind", - "rego" + "rego", + "severity", + "templateName" ], "properties": { "deprecated": { @@ -15981,6 +16007,9 @@ }, "github_com_openinfradev_tks-api_pkg_domain_admin.UpdatePolicyTemplateRequest": { "type": "object", + "required": [ + "templateName" + ], "properties": { "deprecated": { "type": "boolean", diff --git a/api/swagger/swagger.yaml b/api/swagger/swagger.yaml index ce870a9e..17bb87b0 100644 --- a/api/swagger/swagger.yaml +++ b/api/swagger/swagger.yaml @@ -965,6 +965,10 @@ definitions: description: type: string enforcementAction: + enum: + - deny + - dryrun + - warn example: deny type: string mandatory: @@ -993,6 +997,9 @@ definitions: templateId: example: d98ef5f1-4a68-4047-a446-2207787ce3ff type: string + required: + - enforcementAction + - policyName type: object github_com_openinfradev_tks-api_pkg_domain.CreatePolicyResponse: properties: @@ -1046,6 +1053,8 @@ definitions: required: - kind - rego + - severity + - templateName type: object github_com_openinfradev_tks-api_pkg_domain.CreatePolicyTemplateVersionRequest: properties: @@ -3492,6 +3501,11 @@ definitions: description: type: string enforcementAction: + enum: + - deny + - dryrun + - warn + example: deny type: string mandatory: type: boolean @@ -3515,6 +3529,9 @@ definitions: templateId: example: d98ef5f1-4a68-4047-a446-2207787ce3ff type: string + required: + - enforcementAction + - policyName type: object github_com_openinfradev_tks-api_pkg_domain.UpdatePolicyTemplateRequest: properties: @@ -3537,6 +3554,8 @@ definitions: templateName: example: 필수 Label 검사 type: string + required: + - templateName type: object github_com_openinfradev_tks-api_pkg_domain.UpdatePrimaryClusterRequest: properties: @@ -3906,6 +3925,8 @@ definitions: required: - kind - rego + - severity + - templateName type: object github_com_openinfradev_tks-api_pkg_domain_admin.CreatePolicyTemplateVersionRequest: properties: @@ -4129,6 +4150,8 @@ definitions: templateName: example: 필수 Label 검사 type: string + required: + - templateName type: object github_com_openinfradev_tks-api_pkg_httpErrors.RestError: properties: diff --git a/internal/delivery/http/organization.go b/internal/delivery/http/organization.go index 4821dbdd..65c5c545 100644 --- a/internal/delivery/http/organization.go +++ b/internal/delivery/http/organization.go @@ -148,13 +148,17 @@ func (h *OrganizationHandler) Admin_CreateOrganization(w http.ResponseWriter, r } organization.AdminId = &admin.ID - // Default systemNotificationRules 생성 - err = h.systemNotificationRuleUsecase.MakeDefaultSystemNotificationRules(r.Context(), organizationId, &organization) - if err != nil { - log.Errorf(r.Context(), "error is :%s(%T)", err.Error(), err) - ErrorJSON(w, r, err) - return - } + /* + 0415 팀미팅의 결과, 기본 시스템 알림은 decapod 시스템을 사용한다. + + // Default systemNotificationRules 생성 + err = h.systemNotificationRuleUsecase.MakeDefaultSystemNotificationRules(r.Context(), organizationId, &organization) + if err != nil { + log.Errorf(r.Context(), "error is :%s(%T)", err.Error(), err) + ErrorJSON(w, r, err) + return + } + */ var out domain.CreateOrganizationResponse if err = serializer.Map(r.Context(), organization, &out); err != nil {