Fix inconsistent naming for private data endpoint
This commit is contained in:
@@ -978,7 +978,7 @@ endpoints:
|
||||
entrypoint: dataPrivacy
|
||||
path: "/data-privacy"
|
||||
apis:
|
||||
- name: list sensitive data
|
||||
- name: sensitive data list
|
||||
method: GET
|
||||
title: List sensitive data
|
||||
path: /sensitive-data
|
||||
|
||||
@@ -48,7 +48,7 @@ func (DataPrivacy) New() *DataPrivacy {
|
||||
}
|
||||
}
|
||||
|
||||
func (ctrl *DataPrivacy) ListSensitiveData(ctx context.Context, r *request.DataPrivacyListSensitiveData) (out interface{}, err error) {
|
||||
func (ctrl *DataPrivacy) SensitiveDataList(ctx context.Context, r *request.DataPrivacySensitiveDataList) (out interface{}, err error) {
|
||||
outSet := sensitiveDataSetPayload{}
|
||||
|
||||
primaryConnID := dal.Service().PrimaryConnectionID(ctx)
|
||||
|
||||
@@ -19,26 +19,26 @@ import (
|
||||
type (
|
||||
// Internal API interface
|
||||
DataPrivacyAPI interface {
|
||||
ListSensitiveData(context.Context, *request.DataPrivacyListSensitiveData) (interface{}, error)
|
||||
SensitiveDataList(context.Context, *request.DataPrivacySensitiveDataList) (interface{}, error)
|
||||
}
|
||||
|
||||
// HTTP API interface
|
||||
DataPrivacy struct {
|
||||
ListSensitiveData func(http.ResponseWriter, *http.Request)
|
||||
SensitiveDataList func(http.ResponseWriter, *http.Request)
|
||||
}
|
||||
)
|
||||
|
||||
func NewDataPrivacy(h DataPrivacyAPI) *DataPrivacy {
|
||||
return &DataPrivacy{
|
||||
ListSensitiveData: func(w http.ResponseWriter, r *http.Request) {
|
||||
SensitiveDataList: func(w http.ResponseWriter, r *http.Request) {
|
||||
defer r.Body.Close()
|
||||
params := request.NewDataPrivacyListSensitiveData()
|
||||
params := request.NewDataPrivacySensitiveDataList()
|
||||
if err := params.Fill(r); err != nil {
|
||||
api.Send(w, r, err)
|
||||
return
|
||||
}
|
||||
|
||||
value, err := h.ListSensitiveData(r.Context(), params)
|
||||
value, err := h.SensitiveDataList(r.Context(), params)
|
||||
if err != nil {
|
||||
api.Send(w, r, err)
|
||||
return
|
||||
@@ -52,6 +52,6 @@ func NewDataPrivacy(h DataPrivacyAPI) *DataPrivacy {
|
||||
func (h DataPrivacy) MountRoutes(r chi.Router, middlewares ...func(http.Handler) http.Handler) {
|
||||
r.Group(func(r chi.Router) {
|
||||
r.Use(middlewares...)
|
||||
r.Get("/data-privacy/sensitive-data", h.ListSensitiveData)
|
||||
r.Get("/data-privacy/sensitive-data", h.SensitiveDataList)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ var (
|
||||
|
||||
type (
|
||||
// Internal API interface
|
||||
DataPrivacyListSensitiveData struct {
|
||||
DataPrivacySensitiveDataList struct {
|
||||
// SensitivityLevelID GET parameter
|
||||
//
|
||||
// Sensitivity Level ID
|
||||
@@ -46,13 +46,13 @@ type (
|
||||
}
|
||||
)
|
||||
|
||||
// NewDataPrivacyListSensitiveData request
|
||||
func NewDataPrivacyListSensitiveData() *DataPrivacyListSensitiveData {
|
||||
return &DataPrivacyListSensitiveData{}
|
||||
// NewDataPrivacySensitiveDataList request
|
||||
func NewDataPrivacySensitiveDataList() *DataPrivacySensitiveDataList {
|
||||
return &DataPrivacySensitiveDataList{}
|
||||
}
|
||||
|
||||
// Auditable returns all auditable/loggable parameters
|
||||
func (r DataPrivacyListSensitiveData) Auditable() map[string]interface{} {
|
||||
func (r DataPrivacySensitiveDataList) Auditable() map[string]interface{} {
|
||||
return map[string]interface{}{
|
||||
"sensitivityLevelID": r.SensitivityLevelID,
|
||||
"connectionID": r.ConnectionID,
|
||||
@@ -60,17 +60,17 @@ func (r DataPrivacyListSensitiveData) Auditable() map[string]interface{} {
|
||||
}
|
||||
|
||||
// Auditable returns all auditable/loggable parameters
|
||||
func (r DataPrivacyListSensitiveData) GetSensitivityLevelID() uint64 {
|
||||
func (r DataPrivacySensitiveDataList) GetSensitivityLevelID() uint64 {
|
||||
return r.SensitivityLevelID
|
||||
}
|
||||
|
||||
// Auditable returns all auditable/loggable parameters
|
||||
func (r DataPrivacyListSensitiveData) GetConnectionID() []string {
|
||||
func (r DataPrivacySensitiveDataList) GetConnectionID() []string {
|
||||
return r.ConnectionID
|
||||
}
|
||||
|
||||
// Fill processes request and fills internal variables
|
||||
func (r *DataPrivacyListSensitiveData) Fill(req *http.Request) (err error) {
|
||||
func (r *DataPrivacySensitiveDataList) Fill(req *http.Request) (err error) {
|
||||
|
||||
{
|
||||
// GET params
|
||||
|
||||
Reference in New Issue
Block a user