Rename mitigation into mesure
Signed-off-by: gearnode <bryan@frimin.fr>
This commit is contained in:
@@ -39,23 +39,23 @@ enum OrderDirection
|
||||
DESC @goEnum(value: "github.com/getprobo/probo/pkg/page.OrderDirectionDesc")
|
||||
}
|
||||
|
||||
enum MitigationState
|
||||
@goModel(model: "github.com/getprobo/probo/pkg/coredata.MitigationState") {
|
||||
enum MesureState
|
||||
@goModel(model: "github.com/getprobo/probo/pkg/coredata.MesureState") {
|
||||
NOT_STARTED
|
||||
@goEnum(
|
||||
value: "github.com/getprobo/probo/pkg/coredata.MitigationStateNotStarted"
|
||||
value: "github.com/getprobo/probo/pkg/coredata.MesureStateNotStarted"
|
||||
)
|
||||
IN_PROGRESS
|
||||
@goEnum(
|
||||
value: "github.com/getprobo/probo/pkg/coredata.MitigationStateInProgress"
|
||||
value: "github.com/getprobo/probo/pkg/coredata.MesureStateInProgress"
|
||||
)
|
||||
NOT_APPLICABLE
|
||||
@goEnum(
|
||||
value: "github.com/getprobo/probo/pkg/coredata.MitigationStateNotApplicable"
|
||||
value: "github.com/getprobo/probo/pkg/coredata.MesureStateNotApplicable"
|
||||
)
|
||||
IMPLEMENTED
|
||||
@goEnum(
|
||||
value: "github.com/getprobo/probo/pkg/coredata.MitigationStateImplemented"
|
||||
value: "github.com/getprobo/probo/pkg/coredata.MesureStateImplemented"
|
||||
)
|
||||
}
|
||||
|
||||
@@ -91,21 +91,19 @@ enum PeopleKind
|
||||
)
|
||||
}
|
||||
|
||||
enum MitigationImportance
|
||||
@goModel(
|
||||
model: "github.com/getprobo/probo/pkg/coredata.MitigationImportance"
|
||||
) {
|
||||
enum MesureImportance
|
||||
@goModel(model: "github.com/getprobo/probo/pkg/coredata.MesureImportance") {
|
||||
MANDATORY
|
||||
@goEnum(
|
||||
value: "github.com/getprobo/probo/pkg/coredata.MitigationImportanceMandatory"
|
||||
value: "github.com/getprobo/probo/pkg/coredata.MesureImportanceMandatory"
|
||||
)
|
||||
PREFERRED
|
||||
@goEnum(
|
||||
value: "github.com/getprobo/probo/pkg/coredata.MitigationImportancePreferred"
|
||||
value: "github.com/getprobo/probo/pkg/coredata.MesureImportancePreferred"
|
||||
)
|
||||
ADVANCED
|
||||
@goEnum(
|
||||
value: "github.com/getprobo/probo/pkg/coredata.MitigationImportanceAdvanced"
|
||||
value: "github.com/getprobo/probo/pkg/coredata.MesureImportanceAdvanced"
|
||||
)
|
||||
}
|
||||
|
||||
@@ -213,13 +211,11 @@ enum ControlOrderField
|
||||
)
|
||||
}
|
||||
|
||||
enum MitigationOrderField
|
||||
@goModel(
|
||||
model: "github.com/getprobo/probo/pkg/coredata.MitigationOrderField"
|
||||
) {
|
||||
enum MesureOrderField
|
||||
@goModel(model: "github.com/getprobo/probo/pkg/coredata.MesureOrderField") {
|
||||
CREATED_AT
|
||||
@goEnum(
|
||||
value: "github.com/getprobo/probo/pkg/coredata.MitigationOrderFieldCreatedAt"
|
||||
value: "github.com/getprobo/probo/pkg/coredata.MesureOrderFieldCreatedAt"
|
||||
)
|
||||
}
|
||||
|
||||
@@ -307,12 +303,12 @@ input ControlOrder
|
||||
field: ControlOrderField!
|
||||
}
|
||||
|
||||
input MitigationOrder
|
||||
input MesureOrder
|
||||
@goModel(
|
||||
model: "github.com/getprobo/probo/pkg/server/api/console/v1/types.MitigationOrderBy"
|
||||
model: "github.com/getprobo/probo/pkg/server/api/console/v1/types.MesureOrderBy"
|
||||
) {
|
||||
direction: OrderDirection!
|
||||
field: MitigationOrderField!
|
||||
field: MesureOrderField!
|
||||
}
|
||||
|
||||
input TaskOrder
|
||||
@@ -406,13 +402,13 @@ type Organization implements Node {
|
||||
orderBy: PolicyOrder
|
||||
): PolicyConnection! @goField(forceResolver: true)
|
||||
|
||||
mitigations(
|
||||
mesures(
|
||||
first: Int
|
||||
after: CursorKey
|
||||
last: Int
|
||||
before: CursorKey
|
||||
orderBy: MitigationOrder
|
||||
): MitigationConnection! @goField(forceResolver: true)
|
||||
orderBy: MesureOrder
|
||||
): MesureConnection! @goField(forceResolver: true)
|
||||
|
||||
risks(
|
||||
first: Int
|
||||
@@ -516,13 +512,13 @@ type Control implements Node {
|
||||
name: String!
|
||||
description: String!
|
||||
|
||||
mitigations(
|
||||
mesures(
|
||||
first: Int
|
||||
after: CursorKey
|
||||
last: Int
|
||||
before: CursorKey
|
||||
orderBy: MitigationOrder
|
||||
): MitigationConnection! @goField(forceResolver: true)
|
||||
orderBy: MesureOrder
|
||||
): MesureConnection! @goField(forceResolver: true)
|
||||
|
||||
policies(
|
||||
first: Int
|
||||
@@ -536,13 +532,13 @@ type Control implements Node {
|
||||
updatedAt: Datetime!
|
||||
}
|
||||
|
||||
type Mitigation implements Node {
|
||||
type Mesure implements Node {
|
||||
id: ID!
|
||||
category: String!
|
||||
name: String!
|
||||
description: String!
|
||||
state: MitigationState!
|
||||
importance: MitigationImportance!
|
||||
state: MesureState!
|
||||
importance: MesureImportance!
|
||||
|
||||
tasks(
|
||||
first: Int
|
||||
@@ -641,13 +637,13 @@ type Risk implements Node {
|
||||
|
||||
owner: People @goField(forceResolver: true)
|
||||
|
||||
mitigations(
|
||||
mesures(
|
||||
first: Int
|
||||
after: CursorKey
|
||||
last: Int
|
||||
before: CursorKey
|
||||
orderBy: MitigationOrder
|
||||
): MitigationConnection! @goField(forceResolver: true)
|
||||
orderBy: MesureOrder
|
||||
): MesureConnection! @goField(forceResolver: true)
|
||||
|
||||
policies(
|
||||
first: Int
|
||||
@@ -748,14 +744,14 @@ type ControlEdge {
|
||||
node: Control!
|
||||
}
|
||||
|
||||
type MitigationConnection {
|
||||
edges: [MitigationEdge!]!
|
||||
type MesureConnection {
|
||||
edges: [MesureEdge!]!
|
||||
pageInfo: PageInfo!
|
||||
}
|
||||
|
||||
type MitigationEdge {
|
||||
type MesureEdge {
|
||||
cursor: CursorKey!
|
||||
node: Mitigation!
|
||||
node: Mesure!
|
||||
}
|
||||
|
||||
type TaskConnection {
|
||||
@@ -847,21 +843,21 @@ type Mutation {
|
||||
importFramework(input: ImportFrameworkInput!): ImportFrameworkPayload!
|
||||
deleteFramework(input: DeleteFrameworkInput!): DeleteFrameworkPayload!
|
||||
|
||||
# Mitigation mutations
|
||||
createMitigation(input: CreateMitigationInput!): CreateMitigationPayload!
|
||||
updateMitigation(input: UpdateMitigationInput!): UpdateMitigationPayload!
|
||||
importMitigation(input: ImportMitigationInput!): ImportMitigationPayload!
|
||||
# Mesure mutations
|
||||
createMesure(input: CreateMesureInput!): CreateMesurePayload!
|
||||
updateMesure(input: UpdateMesureInput!): UpdateMesurePayload!
|
||||
importMesure(input: ImportMesureInput!): ImportMesurePayload!
|
||||
|
||||
# Control mutations
|
||||
createControlMitigationMapping(
|
||||
input: CreateControlMitigationMappingInput!
|
||||
): CreateControlMitigationMappingPayload!
|
||||
createControlMesureMapping(
|
||||
input: CreateControlMesureMappingInput!
|
||||
): CreateControlMesureMappingPayload!
|
||||
createControlPolicyMapping(
|
||||
input: CreateControlPolicyMappingInput!
|
||||
): CreateControlPolicyMappingPayload!
|
||||
deleteControlMitigationMapping(
|
||||
input: DeleteControlMitigationMappingInput!
|
||||
): DeleteControlMitigationMappingPayload!
|
||||
deleteControlMesureMapping(
|
||||
input: DeleteControlMesureMappingInput!
|
||||
): DeleteControlMesureMappingPayload!
|
||||
deleteControlPolicyMapping(
|
||||
input: DeleteControlPolicyMappingInput!
|
||||
): DeleteControlPolicyMappingPayload!
|
||||
@@ -877,12 +873,12 @@ type Mutation {
|
||||
createRisk(input: CreateRiskInput!): CreateRiskPayload!
|
||||
updateRisk(input: UpdateRiskInput!): UpdateRiskPayload!
|
||||
deleteRisk(input: DeleteRiskInput!): DeleteRiskPayload!
|
||||
createRiskMitigationMapping(
|
||||
input: CreateRiskMitigationMappingInput!
|
||||
): CreateRiskMitigationMappingPayload!
|
||||
deleteRiskMitigationMapping(
|
||||
input: DeleteRiskMitigationMappingInput!
|
||||
): DeleteRiskMitigationMappingPayload!
|
||||
createRiskMesureMapping(
|
||||
input: CreateRiskMesureMappingInput!
|
||||
): CreateRiskMesureMappingPayload!
|
||||
deleteRiskMesureMapping(
|
||||
input: DeleteRiskMesureMappingInput!
|
||||
): DeleteRiskMesureMappingPayload!
|
||||
|
||||
createRiskPolicyMapping(
|
||||
input: CreateRiskPolicyMappingInput!
|
||||
@@ -1019,30 +1015,30 @@ input DeleteFrameworkInput {
|
||||
frameworkId: ID!
|
||||
}
|
||||
|
||||
input CreateMitigationInput {
|
||||
input CreateMesureInput {
|
||||
organizationId: ID!
|
||||
name: String!
|
||||
description: String!
|
||||
category: String!
|
||||
importance: MitigationImportance!
|
||||
importance: MesureImportance!
|
||||
}
|
||||
|
||||
input UpdateMitigationInput {
|
||||
input UpdateMesureInput {
|
||||
id: ID!
|
||||
name: String
|
||||
description: String
|
||||
category: String
|
||||
state: MitigationState
|
||||
importance: MitigationImportance
|
||||
state: MesureState
|
||||
importance: MesureImportance
|
||||
}
|
||||
|
||||
input ImportMitigationInput {
|
||||
input ImportMesureInput {
|
||||
organizationId: ID!
|
||||
file: Upload!
|
||||
}
|
||||
|
||||
input CreateTaskInput {
|
||||
mitigationId: ID!
|
||||
mesureId: ID!
|
||||
name: String!
|
||||
description: String!
|
||||
timeEstimate: Duration
|
||||
@@ -1070,9 +1066,9 @@ input UnassignTaskInput {
|
||||
taskId: ID!
|
||||
}
|
||||
|
||||
input CreateControlMitigationMappingInput {
|
||||
input CreateControlMesureMappingInput {
|
||||
controlId: ID!
|
||||
mitigationId: ID!
|
||||
mesureId: ID!
|
||||
}
|
||||
|
||||
input CreateControlPolicyMappingInput {
|
||||
@@ -1080,9 +1076,9 @@ input CreateControlPolicyMappingInput {
|
||||
policyId: ID!
|
||||
}
|
||||
|
||||
input DeleteControlMitigationMappingInput {
|
||||
input DeleteControlMesureMappingInput {
|
||||
controlId: ID!
|
||||
mitigationId: ID!
|
||||
mesureId: ID!
|
||||
}
|
||||
|
||||
input DeleteControlPolicyMappingInput {
|
||||
@@ -1118,14 +1114,14 @@ input DeleteRiskInput {
|
||||
riskId: ID!
|
||||
}
|
||||
|
||||
input CreateRiskMitigationMappingInput {
|
||||
input CreateRiskMesureMappingInput {
|
||||
riskId: ID!
|
||||
mitigationId: ID!
|
||||
mesureId: ID!
|
||||
}
|
||||
|
||||
input DeleteRiskMitigationMappingInput {
|
||||
input DeleteRiskMesureMappingInput {
|
||||
riskId: ID!
|
||||
mitigationId: ID!
|
||||
mesureId: ID!
|
||||
}
|
||||
|
||||
input CreateRiskPolicyMappingInput {
|
||||
@@ -1267,16 +1263,16 @@ type DeleteFrameworkPayload {
|
||||
deletedFrameworkId: ID!
|
||||
}
|
||||
|
||||
type CreateMitigationPayload {
|
||||
mitigationEdge: MitigationEdge!
|
||||
type CreateMesurePayload {
|
||||
mesureEdge: MesureEdge!
|
||||
}
|
||||
|
||||
type UpdateMitigationPayload {
|
||||
mitigation: Mitigation!
|
||||
type UpdateMesurePayload {
|
||||
mesure: Mesure!
|
||||
}
|
||||
|
||||
type ImportMitigationPayload {
|
||||
mitigationEdges: [MitigationEdge!]!
|
||||
type ImportMesurePayload {
|
||||
mesureEdges: [MesureEdge!]!
|
||||
}
|
||||
|
||||
type CreateTaskPayload {
|
||||
@@ -1299,7 +1295,7 @@ type UnassignTaskPayload {
|
||||
task: Task!
|
||||
}
|
||||
|
||||
type CreateControlMitigationMappingPayload {
|
||||
type CreateControlMesureMappingPayload {
|
||||
success: Boolean!
|
||||
}
|
||||
|
||||
@@ -1307,7 +1303,7 @@ type CreateControlPolicyMappingPayload {
|
||||
success: Boolean!
|
||||
}
|
||||
|
||||
type DeleteControlMitigationMappingPayload {
|
||||
type DeleteControlMesureMappingPayload {
|
||||
success: Boolean!
|
||||
}
|
||||
|
||||
@@ -1327,11 +1323,11 @@ type DeleteRiskPayload {
|
||||
deletedRiskId: ID!
|
||||
}
|
||||
|
||||
type CreateRiskMitigationMappingPayload {
|
||||
type CreateRiskMesureMappingPayload {
|
||||
success: Boolean!
|
||||
}
|
||||
|
||||
type DeleteRiskMitigationMappingPayload {
|
||||
type DeleteRiskMesureMappingPayload {
|
||||
success: Boolean!
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -20,31 +20,31 @@ import (
|
||||
)
|
||||
|
||||
type (
|
||||
MitigationOrderBy OrderBy[coredata.MitigationOrderField]
|
||||
MesureOrderBy OrderBy[coredata.MesureOrderField]
|
||||
)
|
||||
|
||||
func NewMitigationConnection(p *page.Page[*coredata.Mitigation, coredata.MitigationOrderField]) *MitigationConnection {
|
||||
var edges = make([]*MitigationEdge, len(p.Data))
|
||||
func NewMesureConnection(p *page.Page[*coredata.Mesure, coredata.MesureOrderField]) *MesureConnection {
|
||||
var edges = make([]*MesureEdge, len(p.Data))
|
||||
|
||||
for i := range edges {
|
||||
edges[i] = NewMitigationEdge(p.Data[i], p.Cursor.OrderBy.Field)
|
||||
edges[i] = NewMesureEdge(p.Data[i], p.Cursor.OrderBy.Field)
|
||||
}
|
||||
|
||||
return &MitigationConnection{
|
||||
return &MesureConnection{
|
||||
Edges: edges,
|
||||
PageInfo: NewPageInfo(p),
|
||||
}
|
||||
}
|
||||
|
||||
func NewMitigationEdge(c *coredata.Mitigation, orderBy coredata.MitigationOrderField) *MitigationEdge {
|
||||
return &MitigationEdge{
|
||||
func NewMesureEdge(c *coredata.Mesure, orderBy coredata.MesureOrderField) *MesureEdge {
|
||||
return &MesureEdge{
|
||||
Cursor: c.CursorKey(orderBy),
|
||||
Node: NewMitigation(c),
|
||||
Node: NewMesure(c),
|
||||
}
|
||||
}
|
||||
|
||||
func NewMitigation(c *coredata.Mitigation) *Mitigation {
|
||||
return &Mitigation{
|
||||
func NewMesure(c *coredata.Mesure) *Mesure {
|
||||
return &Mesure{
|
||||
ID: c.ID,
|
||||
Category: c.Category,
|
||||
Name: c.Name,
|
||||
@@ -37,14 +37,14 @@ type ConfirmEmailPayload struct {
|
||||
}
|
||||
|
||||
type Control struct {
|
||||
ID gid.GID `json:"id"`
|
||||
ReferenceID string `json:"referenceId"`
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description"`
|
||||
Mitigations *MitigationConnection `json:"mitigations"`
|
||||
Policies *PolicyConnection `json:"policies"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
ID gid.GID `json:"id"`
|
||||
ReferenceID string `json:"referenceId"`
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description"`
|
||||
Mesures *MesureConnection `json:"mesures"`
|
||||
Policies *PolicyConnection `json:"policies"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
}
|
||||
|
||||
func (Control) IsNode() {}
|
||||
@@ -60,12 +60,12 @@ type ControlEdge struct {
|
||||
Node *Control `json:"node"`
|
||||
}
|
||||
|
||||
type CreateControlMitigationMappingInput struct {
|
||||
ControlID gid.GID `json:"controlId"`
|
||||
MitigationID gid.GID `json:"mitigationId"`
|
||||
type CreateControlMesureMappingInput struct {
|
||||
ControlID gid.GID `json:"controlId"`
|
||||
MesureID gid.GID `json:"mesureId"`
|
||||
}
|
||||
|
||||
type CreateControlMitigationMappingPayload struct {
|
||||
type CreateControlMesureMappingPayload struct {
|
||||
Success bool `json:"success"`
|
||||
}
|
||||
|
||||
@@ -101,16 +101,16 @@ type CreateFrameworkPayload struct {
|
||||
FrameworkEdge *FrameworkEdge `json:"frameworkEdge"`
|
||||
}
|
||||
|
||||
type CreateMitigationInput struct {
|
||||
OrganizationID gid.GID `json:"organizationId"`
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description"`
|
||||
Category string `json:"category"`
|
||||
Importance coredata.MitigationImportance `json:"importance"`
|
||||
type CreateMesureInput struct {
|
||||
OrganizationID gid.GID `json:"organizationId"`
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description"`
|
||||
Category string `json:"category"`
|
||||
Importance coredata.MesureImportance `json:"importance"`
|
||||
}
|
||||
|
||||
type CreateMitigationPayload struct {
|
||||
MitigationEdge *MitigationEdge `json:"mitigationEdge"`
|
||||
type CreateMesurePayload struct {
|
||||
MesureEdge *MesureEdge `json:"mesureEdge"`
|
||||
}
|
||||
|
||||
type CreateOrganizationInput struct {
|
||||
@@ -158,12 +158,12 @@ type CreateRiskInput struct {
|
||||
ResidualImpact *float64 `json:"residualImpact,omitempty"`
|
||||
}
|
||||
|
||||
type CreateRiskMitigationMappingInput struct {
|
||||
RiskID gid.GID `json:"riskId"`
|
||||
MitigationID gid.GID `json:"mitigationId"`
|
||||
type CreateRiskMesureMappingInput struct {
|
||||
RiskID gid.GID `json:"riskId"`
|
||||
MesureID gid.GID `json:"mesureId"`
|
||||
}
|
||||
|
||||
type CreateRiskMitigationMappingPayload struct {
|
||||
type CreateRiskMesureMappingPayload struct {
|
||||
Success bool `json:"success"`
|
||||
}
|
||||
|
||||
@@ -181,7 +181,7 @@ type CreateRiskPolicyMappingPayload struct {
|
||||
}
|
||||
|
||||
type CreateTaskInput struct {
|
||||
MitigationID gid.GID `json:"mitigationId"`
|
||||
MesureID gid.GID `json:"mesureId"`
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description"`
|
||||
TimeEstimate *time.Duration `json:"timeEstimate,omitempty"`
|
||||
@@ -220,12 +220,12 @@ type CreateVendorPayload struct {
|
||||
VendorEdge *VendorEdge `json:"vendorEdge"`
|
||||
}
|
||||
|
||||
type DeleteControlMitigationMappingInput struct {
|
||||
ControlID gid.GID `json:"controlId"`
|
||||
MitigationID gid.GID `json:"mitigationId"`
|
||||
type DeleteControlMesureMappingInput struct {
|
||||
ControlID gid.GID `json:"controlId"`
|
||||
MesureID gid.GID `json:"mesureId"`
|
||||
}
|
||||
|
||||
type DeleteControlMitigationMappingPayload struct {
|
||||
type DeleteControlMesureMappingPayload struct {
|
||||
Success bool `json:"success"`
|
||||
}
|
||||
|
||||
@@ -282,12 +282,12 @@ type DeleteRiskInput struct {
|
||||
RiskID gid.GID `json:"riskId"`
|
||||
}
|
||||
|
||||
type DeleteRiskMitigationMappingInput struct {
|
||||
RiskID gid.GID `json:"riskId"`
|
||||
MitigationID gid.GID `json:"mitigationId"`
|
||||
type DeleteRiskMesureMappingInput struct {
|
||||
RiskID gid.GID `json:"riskId"`
|
||||
MesureID gid.GID `json:"mesureId"`
|
||||
}
|
||||
|
||||
type DeleteRiskMitigationMappingPayload struct {
|
||||
type DeleteRiskMesureMappingPayload struct {
|
||||
Success bool `json:"success"`
|
||||
}
|
||||
|
||||
@@ -397,13 +397,13 @@ type ImportFrameworkPayload struct {
|
||||
FrameworkEdge *FrameworkEdge `json:"frameworkEdge"`
|
||||
}
|
||||
|
||||
type ImportMitigationInput struct {
|
||||
type ImportMesureInput struct {
|
||||
OrganizationID gid.GID `json:"organizationId"`
|
||||
File graphql.Upload `json:"file"`
|
||||
}
|
||||
|
||||
type ImportMitigationPayload struct {
|
||||
MitigationEdges []*MitigationEdge `json:"mitigationEdges"`
|
||||
type ImportMesurePayload struct {
|
||||
MesureEdges []*MesureEdge `json:"mesureEdges"`
|
||||
}
|
||||
|
||||
type InviteUserInput struct {
|
||||
@@ -416,49 +416,49 @@ type InviteUserPayload struct {
|
||||
Success bool `json:"success"`
|
||||
}
|
||||
|
||||
type Mitigation struct {
|
||||
ID gid.GID `json:"id"`
|
||||
Category string `json:"category"`
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description"`
|
||||
State coredata.MitigationState `json:"state"`
|
||||
Importance coredata.MitigationImportance `json:"importance"`
|
||||
Tasks *TaskConnection `json:"tasks"`
|
||||
Risks *RiskConnection `json:"risks"`
|
||||
Controls *ControlConnection `json:"controls"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
type Mesure struct {
|
||||
ID gid.GID `json:"id"`
|
||||
Category string `json:"category"`
|
||||
Name string `json:"name"`
|
||||
Description string `json:"description"`
|
||||
State coredata.MesureState `json:"state"`
|
||||
Importance coredata.MesureImportance `json:"importance"`
|
||||
Tasks *TaskConnection `json:"tasks"`
|
||||
Risks *RiskConnection `json:"risks"`
|
||||
Controls *ControlConnection `json:"controls"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
}
|
||||
|
||||
func (Mitigation) IsNode() {}
|
||||
func (this Mitigation) GetID() gid.GID { return this.ID }
|
||||
func (Mesure) IsNode() {}
|
||||
func (this Mesure) GetID() gid.GID { return this.ID }
|
||||
|
||||
type MitigationConnection struct {
|
||||
Edges []*MitigationEdge `json:"edges"`
|
||||
PageInfo *PageInfo `json:"pageInfo"`
|
||||
type MesureConnection struct {
|
||||
Edges []*MesureEdge `json:"edges"`
|
||||
PageInfo *PageInfo `json:"pageInfo"`
|
||||
}
|
||||
|
||||
type MitigationEdge struct {
|
||||
type MesureEdge struct {
|
||||
Cursor page.CursorKey `json:"cursor"`
|
||||
Node *Mitigation `json:"node"`
|
||||
Node *Mesure `json:"node"`
|
||||
}
|
||||
|
||||
type Mutation struct {
|
||||
}
|
||||
|
||||
type Organization struct {
|
||||
ID gid.GID `json:"id"`
|
||||
Name string `json:"name"`
|
||||
LogoURL *string `json:"logoUrl,omitempty"`
|
||||
Users *UserConnection `json:"users"`
|
||||
Frameworks *FrameworkConnection `json:"frameworks"`
|
||||
Vendors *VendorConnection `json:"vendors"`
|
||||
Peoples *PeopleConnection `json:"peoples"`
|
||||
Policies *PolicyConnection `json:"policies"`
|
||||
Mitigations *MitigationConnection `json:"mitigations"`
|
||||
Risks *RiskConnection `json:"risks"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
ID gid.GID `json:"id"`
|
||||
Name string `json:"name"`
|
||||
LogoURL *string `json:"logoUrl,omitempty"`
|
||||
Users *UserConnection `json:"users"`
|
||||
Frameworks *FrameworkConnection `json:"frameworks"`
|
||||
Vendors *VendorConnection `json:"vendors"`
|
||||
Peoples *PeopleConnection `json:"peoples"`
|
||||
Policies *PolicyConnection `json:"policies"`
|
||||
Mesures *MesureConnection `json:"mesures"`
|
||||
Risks *RiskConnection `json:"risks"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
UpdatedAt time.Time `json:"updatedAt"`
|
||||
}
|
||||
|
||||
func (Organization) IsNode() {}
|
||||
@@ -569,7 +569,7 @@ type Risk struct {
|
||||
ResidualImpact float64 `json:"residualImpact"`
|
||||
ResidualSeverity float64 `json:"residualSeverity"`
|
||||
Owner *People `json:"owner,omitempty"`
|
||||
Mitigations *MitigationConnection `json:"mitigations"`
|
||||
Mesures *MesureConnection `json:"mesures"`
|
||||
Policies *PolicyConnection `json:"policies"`
|
||||
Controls *ControlConnection `json:"controls"`
|
||||
CreatedAt time.Time `json:"createdAt"`
|
||||
@@ -637,17 +637,17 @@ type UpdateFrameworkPayload struct {
|
||||
Framework *Framework `json:"framework"`
|
||||
}
|
||||
|
||||
type UpdateMitigationInput struct {
|
||||
ID gid.GID `json:"id"`
|
||||
Name *string `json:"name,omitempty"`
|
||||
Description *string `json:"description,omitempty"`
|
||||
Category *string `json:"category,omitempty"`
|
||||
State *coredata.MitigationState `json:"state,omitempty"`
|
||||
Importance *coredata.MitigationImportance `json:"importance,omitempty"`
|
||||
type UpdateMesureInput struct {
|
||||
ID gid.GID `json:"id"`
|
||||
Name *string `json:"name,omitempty"`
|
||||
Description *string `json:"description,omitempty"`
|
||||
Category *string `json:"category,omitempty"`
|
||||
State *coredata.MesureState `json:"state,omitempty"`
|
||||
Importance *coredata.MesureImportance `json:"importance,omitempty"`
|
||||
}
|
||||
|
||||
type UpdateMitigationPayload struct {
|
||||
Mitigation *Mitigation `json:"mitigation"`
|
||||
type UpdateMesurePayload struct {
|
||||
Mesure *Mesure `json:"mesure"`
|
||||
}
|
||||
|
||||
type UpdateOrganizationInput struct {
|
||||
|
||||
@@ -20,16 +20,16 @@ import (
|
||||
"github.com/vektah/gqlparser/v2/gqlerror"
|
||||
)
|
||||
|
||||
// Mitigations is the resolver for the mitigations field.
|
||||
func (r *controlResolver) Mitigations(ctx context.Context, obj *types.Control, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.MitigationOrderBy) (*types.MitigationConnection, error) {
|
||||
// Mesures is the resolver for the mesures field.
|
||||
func (r *controlResolver) Mesures(ctx context.Context, obj *types.Control, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.MesureOrderBy) (*types.MesureConnection, error) {
|
||||
svc := r.GetTenantServiceIfAuthorized(ctx, obj.ID.TenantID())
|
||||
|
||||
pageOrderBy := page.OrderBy[coredata.MitigationOrderField]{
|
||||
Field: coredata.MitigationOrderFieldCreatedAt,
|
||||
pageOrderBy := page.OrderBy[coredata.MesureOrderField]{
|
||||
Field: coredata.MesureOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
}
|
||||
if orderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.MitigationOrderField]{
|
||||
pageOrderBy = page.OrderBy[coredata.MesureOrderField]{
|
||||
Field: orderBy.Field,
|
||||
Direction: orderBy.Direction,
|
||||
}
|
||||
@@ -37,12 +37,12 @@ func (r *controlResolver) Mitigations(ctx context.Context, obj *types.Control, f
|
||||
|
||||
cursor := types.NewCursor(first, after, last, before, pageOrderBy)
|
||||
|
||||
page, err := svc.Mitigations.ListForControlID(ctx, obj.ID, cursor)
|
||||
page, err := svc.Mesures.ListForControlID(ctx, obj.ID, cursor)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("cannot list mitigations: %w", err)
|
||||
return nil, fmt.Errorf("cannot list mesures: %w", err)
|
||||
}
|
||||
|
||||
return types.NewMitigationConnection(page), nil
|
||||
return types.NewMesureConnection(page), nil
|
||||
}
|
||||
|
||||
// Policies is the resolver for the policies field.
|
||||
@@ -113,7 +113,7 @@ func (r *frameworkResolver) Controls(ctx context.Context, obj *types.Framework,
|
||||
}
|
||||
|
||||
// Tasks is the resolver for the tasks field.
|
||||
func (r *mitigationResolver) Tasks(ctx context.Context, obj *types.Mitigation, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.TaskOrderBy) (*types.TaskConnection, error) {
|
||||
func (r *mesureResolver) Tasks(ctx context.Context, obj *types.Mesure, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.TaskOrderBy) (*types.TaskConnection, error) {
|
||||
svc := r.GetTenantServiceIfAuthorized(ctx, obj.ID.TenantID())
|
||||
|
||||
pageOrderBy := page.OrderBy[coredata.TaskOrderField]{
|
||||
@@ -129,16 +129,16 @@ func (r *mitigationResolver) Tasks(ctx context.Context, obj *types.Mitigation, f
|
||||
|
||||
cursor := types.NewCursor(first, after, last, before, pageOrderBy)
|
||||
|
||||
page, err := svc.Tasks.ListForMitigationID(ctx, obj.ID, cursor)
|
||||
page, err := svc.Tasks.ListForMesureID(ctx, obj.ID, cursor)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("cannot list mitigation tasks: %w", err)
|
||||
return nil, fmt.Errorf("cannot list mesure tasks: %w", err)
|
||||
}
|
||||
|
||||
return types.NewTaskConnection(page), nil
|
||||
}
|
||||
|
||||
// Risks is the resolver for the risks field.
|
||||
func (r *mitigationResolver) Risks(ctx context.Context, obj *types.Mitigation, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.RiskOrderBy) (*types.RiskConnection, error) {
|
||||
func (r *mesureResolver) Risks(ctx context.Context, obj *types.Mesure, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.RiskOrderBy) (*types.RiskConnection, error) {
|
||||
svc := r.GetTenantServiceIfAuthorized(ctx, obj.ID.TenantID())
|
||||
|
||||
pageOrderBy := page.OrderBy[coredata.RiskOrderField]{
|
||||
@@ -154,16 +154,16 @@ func (r *mitigationResolver) Risks(ctx context.Context, obj *types.Mitigation, f
|
||||
|
||||
cursor := types.NewCursor(first, after, last, before, pageOrderBy)
|
||||
|
||||
page, err := svc.Risks.ListForMitigationID(ctx, obj.ID, cursor)
|
||||
page, err := svc.Risks.ListForMesureID(ctx, obj.ID, cursor)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("cannot list mitigation risks: %w", err)
|
||||
return nil, fmt.Errorf("cannot list mesure risks: %w", err)
|
||||
}
|
||||
|
||||
return types.NewRiskConnection(page), nil
|
||||
}
|
||||
|
||||
// Controls is the resolver for the controls field.
|
||||
func (r *mitigationResolver) Controls(ctx context.Context, obj *types.Mitigation, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.ControlOrderBy) (*types.ControlConnection, error) {
|
||||
func (r *mesureResolver) Controls(ctx context.Context, obj *types.Mesure, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.ControlOrderBy) (*types.ControlConnection, error) {
|
||||
svc := r.GetTenantServiceIfAuthorized(ctx, obj.ID.TenantID())
|
||||
|
||||
pageOrderBy := page.OrderBy[coredata.ControlOrderField]{
|
||||
@@ -179,9 +179,9 @@ func (r *mitigationResolver) Controls(ctx context.Context, obj *types.Mitigation
|
||||
|
||||
cursor := types.NewCursor(first, after, last, before, pageOrderBy)
|
||||
|
||||
page, err := svc.Controls.ListForMitigationID(ctx, obj.ID, cursor)
|
||||
page, err := svc.Controls.ListForMesureID(ctx, obj.ID, cursor)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("cannot list mitigation controls: %w", err)
|
||||
return nil, fmt.Errorf("cannot list mesure controls: %w", err)
|
||||
}
|
||||
|
||||
return types.NewControlConnection(page), nil
|
||||
@@ -518,11 +518,11 @@ func (r *mutationResolver) DeleteFramework(ctx context.Context, input types.Dele
|
||||
}, nil
|
||||
}
|
||||
|
||||
// // CreateMitigation is the resolver for the createMitigation field.
|
||||
func (r *mutationResolver) CreateMitigation(ctx context.Context, input types.CreateMitigationInput) (*types.CreateMitigationPayload, error) {
|
||||
// // CreateMesure is the resolver for the createMesure field.
|
||||
func (r *mutationResolver) CreateMesure(ctx context.Context, input types.CreateMesureInput) (*types.CreateMesurePayload, error) {
|
||||
svc := r.GetTenantServiceIfAuthorized(ctx, input.OrganizationID.TenantID())
|
||||
|
||||
mitigation, err := svc.Mitigations.Create(ctx, probo.CreateMitigationRequest{
|
||||
mesure, err := svc.Mesures.Create(ctx, probo.CreateMesureRequest{
|
||||
OrganizationID: input.OrganizationID,
|
||||
Name: input.Name,
|
||||
Description: input.Description,
|
||||
@@ -530,19 +530,19 @@ func (r *mutationResolver) CreateMitigation(ctx context.Context, input types.Cre
|
||||
Importance: input.Importance,
|
||||
})
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("cannot create mitigation: %w", err))
|
||||
panic(fmt.Errorf("cannot create mesure: %w", err))
|
||||
}
|
||||
|
||||
return &types.CreateMitigationPayload{
|
||||
MitigationEdge: types.NewMitigationEdge(mitigation, coredata.MitigationOrderFieldCreatedAt),
|
||||
return &types.CreateMesurePayload{
|
||||
MesureEdge: types.NewMesureEdge(mesure, coredata.MesureOrderFieldCreatedAt),
|
||||
}, nil
|
||||
}
|
||||
|
||||
// UpdateMitigation is the resolver for the updateMitigation field.
|
||||
func (r *mutationResolver) UpdateMitigation(ctx context.Context, input types.UpdateMitigationInput) (*types.UpdateMitigationPayload, error) {
|
||||
// UpdateMesure is the resolver for the updateMesure field.
|
||||
func (r *mutationResolver) UpdateMesure(ctx context.Context, input types.UpdateMesureInput) (*types.UpdateMesurePayload, error) {
|
||||
svc := r.GetTenantServiceIfAuthorized(ctx, input.ID.TenantID())
|
||||
|
||||
mitigation, err := svc.Mitigations.Update(ctx, probo.UpdateMitigationRequest{
|
||||
mesure, err := svc.Mesures.Update(ctx, probo.UpdateMesureRequest{
|
||||
ID: input.ID,
|
||||
Name: input.Name,
|
||||
Description: input.Description,
|
||||
@@ -551,48 +551,48 @@ func (r *mutationResolver) UpdateMitigation(ctx context.Context, input types.Upd
|
||||
State: input.State,
|
||||
})
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("cannot update mitigation: %w", err))
|
||||
panic(fmt.Errorf("cannot update mesure: %w", err))
|
||||
}
|
||||
|
||||
return &types.UpdateMitigationPayload{
|
||||
Mitigation: types.NewMitigation(mitigation),
|
||||
return &types.UpdateMesurePayload{
|
||||
Mesure: types.NewMesure(mesure),
|
||||
}, nil
|
||||
}
|
||||
|
||||
// ImportMitigation is the resolver for the importMitigation field.
|
||||
func (r *mutationResolver) ImportMitigation(ctx context.Context, input types.ImportMitigationInput) (*types.ImportMitigationPayload, error) {
|
||||
// ImportMesure is the resolver for the importMesure field.
|
||||
func (r *mutationResolver) ImportMesure(ctx context.Context, input types.ImportMesureInput) (*types.ImportMesurePayload, error) {
|
||||
svc := r.GetTenantServiceIfAuthorized(ctx, input.OrganizationID.TenantID())
|
||||
|
||||
var req probo.ImportMitigationRequest
|
||||
if err := json.NewDecoder(input.File.File).Decode(&req.Mitigations); err != nil {
|
||||
return nil, fmt.Errorf("cannot unmarshal mitigation: %w", err)
|
||||
var req probo.ImportMesureRequest
|
||||
if err := json.NewDecoder(input.File.File).Decode(&req.Mesures); err != nil {
|
||||
return nil, fmt.Errorf("cannot unmarshal mesure: %w", err)
|
||||
}
|
||||
|
||||
mitigations, err := svc.Mitigations.Import(ctx, input.OrganizationID, req)
|
||||
mesures, err := svc.Mesures.Import(ctx, input.OrganizationID, req)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("cannot import mitigation: %w", err)
|
||||
return nil, fmt.Errorf("cannot import mesure: %w", err)
|
||||
}
|
||||
|
||||
mitigationEdges := make([]*types.MitigationEdge, len(mitigations.Data))
|
||||
for i, mitigation := range mitigations.Data {
|
||||
mitigationEdges[i] = types.NewMitigationEdge(mitigation, coredata.MitigationOrderFieldCreatedAt)
|
||||
mesureEdges := make([]*types.MesureEdge, len(mesures.Data))
|
||||
for i, mesure := range mesures.Data {
|
||||
mesureEdges[i] = types.NewMesureEdge(mesure, coredata.MesureOrderFieldCreatedAt)
|
||||
}
|
||||
|
||||
return &types.ImportMitigationPayload{
|
||||
MitigationEdges: mitigationEdges,
|
||||
return &types.ImportMesurePayload{
|
||||
MesureEdges: mesureEdges,
|
||||
}, nil
|
||||
}
|
||||
|
||||
// CreateControlMitigationMapping is the resolver for the createControlMitigationMapping field.
|
||||
func (r *mutationResolver) CreateControlMitigationMapping(ctx context.Context, input types.CreateControlMitigationMappingInput) (*types.CreateControlMitigationMappingPayload, error) {
|
||||
svc := r.GetTenantServiceIfAuthorized(ctx, input.MitigationID.TenantID())
|
||||
// CreateControlMesureMapping is the resolver for the createControlMesureMapping field.
|
||||
func (r *mutationResolver) CreateControlMesureMapping(ctx context.Context, input types.CreateControlMesureMappingInput) (*types.CreateControlMesureMappingPayload, error) {
|
||||
svc := r.GetTenantServiceIfAuthorized(ctx, input.MesureID.TenantID())
|
||||
|
||||
err := svc.Controls.CreateMitigationMapping(ctx, input.ControlID, input.MitigationID)
|
||||
err := svc.Controls.CreateMesureMapping(ctx, input.ControlID, input.MesureID)
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("cannot create control mitigation mapping: %w", err))
|
||||
panic(fmt.Errorf("cannot create control mesure mapping: %w", err))
|
||||
}
|
||||
|
||||
return &types.CreateControlMitigationMappingPayload{
|
||||
return &types.CreateControlMesureMappingPayload{
|
||||
Success: true,
|
||||
}, nil
|
||||
}
|
||||
@@ -611,16 +611,16 @@ func (r *mutationResolver) CreateControlPolicyMapping(ctx context.Context, input
|
||||
}, nil
|
||||
}
|
||||
|
||||
// DeleteControlMitigationMapping is the resolver for the deleteControlMitigationMapping field.
|
||||
func (r *mutationResolver) DeleteControlMitigationMapping(ctx context.Context, input types.DeleteControlMitigationMappingInput) (*types.DeleteControlMitigationMappingPayload, error) {
|
||||
svc := r.GetTenantServiceIfAuthorized(ctx, input.MitigationID.TenantID())
|
||||
// DeleteControlMesureMapping is the resolver for the deleteControlMesureMapping field.
|
||||
func (r *mutationResolver) DeleteControlMesureMapping(ctx context.Context, input types.DeleteControlMesureMappingInput) (*types.DeleteControlMesureMappingPayload, error) {
|
||||
svc := r.GetTenantServiceIfAuthorized(ctx, input.MesureID.TenantID())
|
||||
|
||||
err := svc.Controls.DeleteMitigationMapping(ctx, input.ControlID, input.MitigationID)
|
||||
err := svc.Controls.DeleteMesureMapping(ctx, input.ControlID, input.MesureID)
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("cannot delete control mitigation mapping: %w", err))
|
||||
panic(fmt.Errorf("cannot delete control mesure mapping: %w", err))
|
||||
}
|
||||
|
||||
return &types.DeleteControlMitigationMappingPayload{
|
||||
return &types.DeleteControlMesureMappingPayload{
|
||||
Success: true,
|
||||
}, nil
|
||||
}
|
||||
@@ -641,10 +641,10 @@ func (r *mutationResolver) DeleteControlPolicyMapping(ctx context.Context, input
|
||||
|
||||
// CreateTask is the resolver for the createTask field.
|
||||
func (r *mutationResolver) CreateTask(ctx context.Context, input types.CreateTaskInput) (*types.CreateTaskPayload, error) {
|
||||
svc := r.GetTenantServiceIfAuthorized(ctx, input.MitigationID.TenantID())
|
||||
svc := r.GetTenantServiceIfAuthorized(ctx, input.MesureID.TenantID())
|
||||
|
||||
task, err := svc.Tasks.Create(ctx, probo.CreateTaskRequest{
|
||||
MitigationID: input.MitigationID,
|
||||
MesureID: input.MesureID,
|
||||
Name: input.Name,
|
||||
Description: input.Description,
|
||||
TimeEstimate: input.TimeEstimate,
|
||||
@@ -788,30 +788,30 @@ func (r *mutationResolver) DeleteRisk(ctx context.Context, input types.DeleteRis
|
||||
}, nil
|
||||
}
|
||||
|
||||
// CreateRiskMitigationMapping is the resolver for the createRiskMitigationMapping field.
|
||||
func (r *mutationResolver) CreateRiskMitigationMapping(ctx context.Context, input types.CreateRiskMitigationMappingInput) (*types.CreateRiskMitigationMappingPayload, error) {
|
||||
// CreateRiskMesureMapping is the resolver for the createRiskMesureMapping field.
|
||||
func (r *mutationResolver) CreateRiskMesureMapping(ctx context.Context, input types.CreateRiskMesureMappingInput) (*types.CreateRiskMesureMappingPayload, error) {
|
||||
svc := r.GetTenantServiceIfAuthorized(ctx, input.RiskID.TenantID())
|
||||
|
||||
err := svc.Risks.CreateMitigationMapping(ctx, input.RiskID, input.MitigationID)
|
||||
err := svc.Risks.CreateMesureMapping(ctx, input.RiskID, input.MesureID)
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("cannot create risk mitigation mapping: %w", err))
|
||||
panic(fmt.Errorf("cannot create risk mesure mapping: %w", err))
|
||||
}
|
||||
|
||||
return &types.CreateRiskMitigationMappingPayload{
|
||||
return &types.CreateRiskMesureMappingPayload{
|
||||
Success: true,
|
||||
}, nil
|
||||
}
|
||||
|
||||
// DeleteRiskMitigationMapping is the resolver for the deleteRiskMitigationMapping field.
|
||||
func (r *mutationResolver) DeleteRiskMitigationMapping(ctx context.Context, input types.DeleteRiskMitigationMappingInput) (*types.DeleteRiskMitigationMappingPayload, error) {
|
||||
// DeleteRiskMesureMapping is the resolver for the deleteRiskMesureMapping field.
|
||||
func (r *mutationResolver) DeleteRiskMesureMapping(ctx context.Context, input types.DeleteRiskMesureMappingInput) (*types.DeleteRiskMesureMappingPayload, error) {
|
||||
svc := r.GetTenantServiceIfAuthorized(ctx, input.RiskID.TenantID())
|
||||
|
||||
err := svc.Risks.DeleteMitigationMapping(ctx, input.RiskID, input.MitigationID)
|
||||
err := svc.Risks.DeleteMesureMapping(ctx, input.RiskID, input.MesureID)
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("cannot delete risk mitigation mapping: %w", err))
|
||||
panic(fmt.Errorf("cannot delete risk mesure mapping: %w", err))
|
||||
}
|
||||
|
||||
return &types.DeleteRiskMitigationMappingPayload{
|
||||
return &types.DeleteRiskMesureMappingPayload{
|
||||
Success: true,
|
||||
}, nil
|
||||
}
|
||||
@@ -1162,16 +1162,16 @@ func (r *organizationResolver) Policies(ctx context.Context, obj *types.Organiza
|
||||
return types.NewPolicyConnection(page), nil
|
||||
}
|
||||
|
||||
// Mitigations is the resolver for the mitigations field.
|
||||
func (r *organizationResolver) Mitigations(ctx context.Context, obj *types.Organization, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.MitigationOrderBy) (*types.MitigationConnection, error) {
|
||||
// Mesures is the resolver for the mesures field.
|
||||
func (r *organizationResolver) Mesures(ctx context.Context, obj *types.Organization, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.MesureOrderBy) (*types.MesureConnection, error) {
|
||||
svc := r.GetTenantServiceIfAuthorized(ctx, obj.ID.TenantID())
|
||||
|
||||
pageOrderBy := page.OrderBy[coredata.MitigationOrderField]{
|
||||
Field: coredata.MitigationOrderFieldCreatedAt,
|
||||
pageOrderBy := page.OrderBy[coredata.MesureOrderField]{
|
||||
Field: coredata.MesureOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
}
|
||||
if orderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.MitigationOrderField]{
|
||||
pageOrderBy = page.OrderBy[coredata.MesureOrderField]{
|
||||
Field: orderBy.Field,
|
||||
Direction: orderBy.Direction,
|
||||
}
|
||||
@@ -1179,12 +1179,12 @@ func (r *organizationResolver) Mitigations(ctx context.Context, obj *types.Organ
|
||||
|
||||
cursor := types.NewCursor(first, after, last, before, pageOrderBy)
|
||||
|
||||
page, err := svc.Mitigations.ListForOrganizationID(ctx, obj.ID, cursor)
|
||||
page, err := svc.Mesures.ListForOrganizationID(ctx, obj.ID, cursor)
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("cannot list organization mitigations: %w", err))
|
||||
panic(fmt.Errorf("cannot list organization mesures: %w", err))
|
||||
}
|
||||
|
||||
return types.NewMitigationConnection(page), nil
|
||||
return types.NewMesureConnection(page), nil
|
||||
}
|
||||
|
||||
// Risks is the resolver for the risks field.
|
||||
@@ -1288,13 +1288,13 @@ func (r *queryResolver) Node(ctx context.Context, id gid.GID) (types.Node, error
|
||||
}
|
||||
|
||||
return types.NewFramework(framework), nil
|
||||
case coredata.MitigationEntityType:
|
||||
mitigation, err := svc.Mitigations.Get(ctx, id)
|
||||
case coredata.MesureEntityType:
|
||||
mesure, err := svc.Mesures.Get(ctx, id)
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("cannot get mitigation: %w", err))
|
||||
panic(fmt.Errorf("cannot get mesure: %w", err))
|
||||
}
|
||||
|
||||
return types.NewMitigation(mitigation), nil
|
||||
return types.NewMesure(mesure), nil
|
||||
case coredata.TaskEntityType:
|
||||
task, err := svc.Tasks.Get(ctx, id)
|
||||
if err != nil {
|
||||
@@ -1372,16 +1372,16 @@ func (r *riskResolver) Owner(ctx context.Context, obj *types.Risk) (*types.Peopl
|
||||
return types.NewPeople(owner), nil
|
||||
}
|
||||
|
||||
// Mitigations is the resolver for the mitigations field.
|
||||
func (r *riskResolver) Mitigations(ctx context.Context, obj *types.Risk, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.MitigationOrderBy) (*types.MitigationConnection, error) {
|
||||
// Mesures is the resolver for the mesures field.
|
||||
func (r *riskResolver) Mesures(ctx context.Context, obj *types.Risk, first *int, after *page.CursorKey, last *int, before *page.CursorKey, orderBy *types.MesureOrderBy) (*types.MesureConnection, error) {
|
||||
svc := r.GetTenantServiceIfAuthorized(ctx, obj.ID.TenantID())
|
||||
|
||||
pageOrderBy := page.OrderBy[coredata.MitigationOrderField]{
|
||||
Field: coredata.MitigationOrderFieldCreatedAt,
|
||||
pageOrderBy := page.OrderBy[coredata.MesureOrderField]{
|
||||
Field: coredata.MesureOrderFieldCreatedAt,
|
||||
Direction: page.OrderDirectionDesc,
|
||||
}
|
||||
if orderBy != nil {
|
||||
pageOrderBy = page.OrderBy[coredata.MitigationOrderField]{
|
||||
pageOrderBy = page.OrderBy[coredata.MesureOrderField]{
|
||||
Field: orderBy.Field,
|
||||
Direction: orderBy.Direction,
|
||||
}
|
||||
@@ -1389,12 +1389,12 @@ func (r *riskResolver) Mitigations(ctx context.Context, obj *types.Risk, first *
|
||||
|
||||
cursor := types.NewCursor(first, after, last, before, pageOrderBy)
|
||||
|
||||
page, err := svc.Mitigations.ListForRiskID(ctx, obj.ID, cursor)
|
||||
page, err := svc.Mesures.ListForRiskID(ctx, obj.ID, cursor)
|
||||
if err != nil {
|
||||
panic(fmt.Errorf("cannot list risk mitigations: %w", err))
|
||||
panic(fmt.Errorf("cannot list risk mesures: %w", err))
|
||||
}
|
||||
|
||||
return types.NewMitigationConnection(page), nil
|
||||
return types.NewMesureConnection(page), nil
|
||||
}
|
||||
|
||||
// Policies is the resolver for the policies field.
|
||||
@@ -1617,8 +1617,8 @@ func (r *Resolver) Evidence() schema.EvidenceResolver { return &evidenceResolver
|
||||
// Framework returns schema.FrameworkResolver implementation.
|
||||
func (r *Resolver) Framework() schema.FrameworkResolver { return &frameworkResolver{r} }
|
||||
|
||||
// Mitigation returns schema.MitigationResolver implementation.
|
||||
func (r *Resolver) Mitigation() schema.MitigationResolver { return &mitigationResolver{r} }
|
||||
// Mesure returns schema.MesureResolver implementation.
|
||||
func (r *Resolver) Mesure() schema.MesureResolver { return &mesureResolver{r} }
|
||||
|
||||
// Mutation returns schema.MutationResolver implementation.
|
||||
func (r *Resolver) Mutation() schema.MutationResolver { return &mutationResolver{r} }
|
||||
@@ -1652,7 +1652,7 @@ func (r *Resolver) Viewer() schema.ViewerResolver { return &viewerResolver{r} }
|
||||
type controlResolver struct{ *Resolver }
|
||||
type evidenceResolver struct{ *Resolver }
|
||||
type frameworkResolver struct{ *Resolver }
|
||||
type mitigationResolver struct{ *Resolver }
|
||||
type mesureResolver struct{ *Resolver }
|
||||
type mutationResolver struct{ *Resolver }
|
||||
type organizationResolver struct{ *Resolver }
|
||||
type policyResolver struct{ *Resolver }
|
||||
|
||||
Reference in New Issue
Block a user