diff --git a/audit/utils/converter.go b/audit/api/converter.go similarity index 98% rename from audit/utils/converter.go rename to audit/api/converter.go index 0b53593..190dc22 100644 --- a/audit/utils/converter.go +++ b/audit/api/converter.go @@ -1,4 +1,4 @@ -package utils +package api import ( auditV1 "dev.azure.com/schwarzit/schwarzit.stackit-core-platform/audit-go.git/gen/go/audit/v1" diff --git a/audit/api/model.go b/audit/api/model.go index fb75e8b..f875623 100644 --- a/audit/api/model.go +++ b/audit/api/model.go @@ -1,7 +1,6 @@ package api import ( - "dev.azure.com/schwarzit/schwarzit.stackit-core-platform/audit-go.git/audit/utils" auditV1 "dev.azure.com/schwarzit/schwarzit.stackit-core-platform/audit-go.git/gen/go/audit/v1" "encoding/base64" "encoding/json" @@ -511,7 +510,7 @@ func NewRequestAttributes( return &auditV1.AttributeContext_Request{ Id: requestId, - Method: utils.StringToHttpMethod(request.Method), + Method: StringToHttpMethod(request.Method), Headers: requestHeaders, Path: request.URL.Path, Host: request.Host, @@ -877,7 +876,7 @@ func OperationNameFromUrlPath(path string, requestMethod string) string { operation = strings.TrimPrefix(operation, ".") operation = strings.ToLower(operation) if len(operation) > 0 { - method := utils.StringToHttpMethod(requestMethod) + method := StringToHttpMethod(requestMethod) var action string switch method { case auditV1.AttributeContext_HTTP_METHOD_PUT: diff --git a/audit/schema/routable_event_test.go b/audit/api/schema_validation_test.go similarity index 96% rename from audit/schema/routable_event_test.go rename to audit/api/schema_validation_test.go index 5faa1c4..05e92f2 100644 --- a/audit/schema/routable_event_test.go +++ b/audit/api/schema_validation_test.go @@ -1,7 +1,6 @@ -package schema +package api import ( - "dev.azure.com/schwarzit/schwarzit.stackit-core-platform/audit-go.git/audit/api" auditV1 "dev.azure.com/schwarzit/schwarzit.stackit-core-platform/audit-go.git/gen/go/audit/v1" "github.com/bufbuild/protovalidate-go" "github.com/stretchr/testify/assert" @@ -19,7 +18,7 @@ func Test_RoutableAuditEvent(t *testing.T) { Visibility: auditV1.Visibility_VISIBILITY_PUBLIC, ObjectIdentifier: &auditV1.ObjectIdentifier{ Identifier: "14f7aa86-77ba-4d77-a091-a2cf3395a221", - Type: string(api.SingularTypeProject), + Type: string(SingularTypeProject), }, Data: &auditV1.RoutableAuditEvent_UnencryptedData{UnencryptedData: &auditV1.UnencryptedData{ Data: []byte("data"),