Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #241 Support DPIA configuration in v1 data agreement endpoints #243

Merged
merged 1 commit into from
Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 17 additions & 5 deletions src/handlerv1/organization_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,11 @@ func GetOrganizationRoles(w http.ResponseWriter, r *http.Request) {
w.Write(response)
}

type DPIA struct {
DPIADate string
DPIASummaryUrl string
}

type purpose struct {
Name string `valid:"required"`
Description string `valid:"required"`
Expand All @@ -572,6 +577,7 @@ type purpose struct {
Jurisdiction string
Disclosure string
IndustryScope string
DPIA DPIA
DataRetention org.DataRetention
Restriction string
Shared3PP bool
Expand Down Expand Up @@ -627,10 +633,14 @@ func AddConsentPurposes(w http.ResponseWriter, r *http.Request) {
Jurisdiction: p.Jurisdiction,
Disclosure: p.Disclosure,
IndustryScope: p.IndustryScope,
DataRetention: p.DataRetention,
Restriction: p.Restriction,
Shared3PP: p.Shared3PP,
SSIID: p.SSIID}
DPIA: org.DPIA{
DPIADate: p.DPIA.DPIADate,
DPIASummaryUrl: p.DPIA.DPIASummaryUrl,
},
DataRetention: p.DataRetention,
Restriction: p.Restriction,
Shared3PP: p.Shared3PP,
SSIID: p.SSIID}

o.Purposes = append(o.Purposes, tempPurpose)
}
Expand Down Expand Up @@ -742,7 +752,7 @@ func UpdatePurposeByID(w http.ResponseWriter, r *http.Request) {

// Proceed if lawful basis of processing provided is valid
if !isValidLawfulBasisOfProcessing(uReq.LawfulBasisOfProcessing) {
m := fmt.Sprintf("Invalid lawful basis of processing provided")
m := "Invalid lawful basis of processing provided"
common.HandleError(w, http.StatusBadRequest, m, err)
return
}
Expand All @@ -761,6 +771,8 @@ func UpdatePurposeByID(w http.ResponseWriter, r *http.Request) {
o.Purposes[i].Jurisdiction = uReq.Jurisdiction
o.Purposes[i].Disclosure = uReq.Disclosure
o.Purposes[i].IndustryScope = uReq.IndustryScope
o.Purposes[i].DPIA.DPIADate = uReq.DPIA.DPIADate
o.Purposes[i].DPIA.DPIASummaryUrl = uReq.DPIA.DPIASummaryUrl
o.Purposes[i].DataRetention = uReq.DataRetention
o.Purposes[i].Restriction = uReq.Restriction
o.Purposes[i].Shared3PP = uReq.Shared3PP
Expand Down
5 changes: 5 additions & 0 deletions src/org/organizations.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ type Template struct {
DataExchange bool
Description string
}
type DPIA struct {
DPIADate string
DPIASummaryUrl string
}

// Purpose data type
type Purpose struct {
Expand All @@ -75,6 +79,7 @@ type Purpose struct {
Disclosure string
IndustryScope string
DataRetention DataRetention
DPIA DPIA
Restriction string
Shared3PP bool
SSIID string
Expand Down
Loading