Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Pid
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Coscine
backend
apis
Pid
Commits
20a3056b
Commit
20a3056b
authored
4 years ago
by
David Schimmel
Browse files
Options
Downloads
Patches
Plain Diff
remove additionalInformation column
parent
7d3699d5
No related branches found
No related tags found
1 merge request
!12
WIP: Update: Add analytics log (coscine/issues#1188)
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/Pid/Controllers/PidController.cs
+22
-7
22 additions, 7 deletions
src/Pid/Controllers/PidController.cs
src/Pid/Pid.csproj
+5
-5
5 additions, 5 deletions
src/Pid/Pid.csproj
src/Pid/packages.config
+3
-3
3 additions, 3 deletions
src/Pid/packages.config
with
30 additions
and
15 deletions
src/Pid/Controllers/PidController.cs
+
22
−
7
View file @
20a3056b
...
...
@@ -12,6 +12,7 @@ using Coscine.Api.Pid.Models;
using
Coscine.Action
;
using
Coscine.Action.EventArgs
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Coscine.Api.Pid.Controllers
{
...
...
@@ -54,10 +55,11 @@ namespace Coscine.Api.Pid.Controllers
string
resourceId
=
null
;
string
projectId
=
null
;
string
applicationProfile
=
null
;
string
license
=
null
;
LicenseObject
license
=
null
;
IEnumerable
<
DisciplineObject
>
disciplines
=
null
;
IEnumerable
<
OrganizationObject
>
organizations
=
null
;
string
visibility
=
null
;
string
externalInfo
=
null
;
var
user
=
new
User
()
{
...
...
@@ -81,7 +83,7 @@ namespace Coscine.Api.Pid.Controllers
resourceId
=
resource
.
Id
.
ToString
();
applicationProfile
=
resourceObject
.
ApplicationProfile
;
license
=
resourceObject
.
License
.
DisplayName
;
license
=
resourceObject
.
License
;
project
=
_projectModel
.
GetById
(
projectResourceModel
.
GetAllWhere
((
resourceProject
)
=>
(
resourceProject
.
ResourceId
==
resource
.
Id
))
.
First
().
ProjectId
);
...
...
@@ -105,13 +107,14 @@ namespace Coscine.Api.Pid.Controllers
disciplines
=
projectObject
.
Disciplines
;
organizations
=
projectObject
.
Organizations
;
visibility
=
projectObject
.
Visibility
.
DisplayName
;
externalInfo
=
messageObject
.
Email
;
RoleModel
rolesModel
=
new
RoleModel
();
ProjectRoleModel
projectRoleModel
=
new
ProjectRoleModel
();
Guid
ownerId
=
rolesModel
.
GetAllWhere
((
role
)
=>
(
role
.
DisplayName
==
"owner"
)).
First
().
Id
;
var
projectOwners
=
projectRoleModel
.
GetAllWhere
((
projectRole
)
=>
(
projectRole
.
RoleId
==
ownerId
&&
projectRole
.
ProjectId
==
project
.
Id
));
LogAnalytics
(
"PID Enquiry"
,
resourceId
,
user
,
projectId
,
applicationProfile
,
license
,
disciplines
,
organizations
,
visibility
);
LogAnalytics
(
"PID Enquiry"
,
resourceId
,
user
,
projectId
,
applicationProfile
,
license
,
disciplines
,
organizations
,
visibility
,
projectOwners
,
externalInfo
);
return
Json
(
new
JObject
{
[
"status"
]
=
"ok"
});
}
...
...
@@ -122,11 +125,12 @@ namespace Coscine.Api.Pid.Controllers
User
user
=
null
,
string
projectId
=
null
,
string
applicationProfile
=
null
,
string
license
=
null
,
LicenseObject
license
=
null
,
IEnumerable
<
DisciplineObject
>
disciplines
=
null
,
IEnumerable
<
OrganizationObject
>
organizations
=
null
,
string
visibility
=
null
,
IEnumerable
<
ProjectRole
>
projectOwners
=
null
IEnumerable
<
ProjectRole
>
projectOwners
=
null
,
string
externalInfo
=
null
)
{
if
(
CoscineLoggerConfiguration
.
IsLogLevelActivated
(
LogType
.
Analytics
))
...
...
@@ -139,10 +143,9 @@ namespace Coscine.Api.Pid.Controllers
_analyticsLogObject
.
Type
=
"Action"
;
_analyticsLogObject
.
Operation
=
operation
;
_analyticsLogObject
.
ApplicationsProfile
=
applicationProfile
;
_analyticsLogObject
.
License
=
license
;
_analyticsLogObject
.
ResourceId
=
resourceId
;
_analyticsLogObject
.
Visibility
=
visibility
;
if
(
disciplines
!=
null
&&
disciplines
.
Count
()
>
0
)
{
foreach
(
var
discipline
in
disciplines
)
...
...
@@ -168,6 +171,18 @@ namespace Coscine.Api.Pid.Controllers
}
_analyticsLogObject
.
UserList
=
ownerIds
;
}
if
(
license
!=
null
)
{
_analyticsLogObject
.
License
=
license
.
DisplayName
;
}
/*if (externalInfo != null) // this was for the externalInformation column, original intended use to store the hashed email adress of the requester
{
StringBuilder stringBuilder = new StringBuilder();
foreach (byte b in externalInfo)
stringBuilder.Append(b.ToString("X2"));
externalInfo = stringBuilder.ToString();
_analyticsLogObject.ExternalInfo = externalInfo;
}*/
_coscineLogger
.
AnalyticsLog
(
_analyticsLogObject
);
}
...
...
This diff is collapsed.
Click to expand it.
src/Pid/Pid.csproj
+
5
−
5
View file @
20a3056b
...
...
@@ -54,23 +54,23 @@
<Reference
Include=
"Coscine.Action, Version=1.17.0.0, Culture=neutral, processorArchitecture=AMD64"
>
<HintPath>
..\packages\Coscine.Action.1.17.0\lib\net461\Coscine.Action.dll
</HintPath>
</Reference>
<Reference
Include=
"Coscine.ApiCommons, Version=1.1
1
.0.0, Culture=neutral, PublicKeyToken=af4c1345df96546b, processorArchitecture=MSIL"
>
<HintPath>
..\packages\Coscine.ApiCommons.1.1
1.0
\lib\net461\Coscine.ApiCommons.dll
</HintPath>
<Reference
Include=
"Coscine.ApiCommons, Version=1.1
2
.0.0, Culture=neutral, PublicKeyToken=af4c1345df96546b, processorArchitecture=MSIL"
>
<HintPath>
..\packages\Coscine.ApiCommons.1.1
2.0-topic-1221-loggi0001
\lib\net461\Coscine.ApiCommons.dll
</HintPath>
</Reference>
<Reference
Include=
"Coscine.Configuration, Version=1.5.0.0, Culture=neutral, PublicKeyToken=ce3d7a32d7dc1e5a, processorArchitecture=MSIL"
>
<HintPath>
..\packages\Coscine.Configuration.1.5.0\lib\net461\Coscine.Configuration.dll
</HintPath>
</Reference>
<Reference
Include=
"Coscine.Database, Version=1.28.0.0, Culture=neutral, PublicKeyToken=767d77427707b70a, processorArchitecture=MSIL"
>
<HintPath>
..\packages\Coscine.Database.1.28.0-topic-1221-loggi000
4
\lib\net461\Coscine.Database.dll
</HintPath>
<HintPath>
..\packages\Coscine.Database.1.28.0-topic-1221-loggi000
5
\lib\net461\Coscine.Database.dll
</HintPath>
</Reference>
<Reference
Include=
"Coscine.Database.T4, Version=1.28.0.0, Culture=neutral, PublicKeyToken=84b4c404a0696261, processorArchitecture=MSIL"
>
<HintPath>
..\packages\Coscine.Database.1.28.0-topic-1221-loggi000
4
\lib\net461\Coscine.Database.T4.dll
</HintPath>
<HintPath>
..\packages\Coscine.Database.1.28.0-topic-1221-loggi000
5
\lib\net461\Coscine.Database.T4.dll
</HintPath>
</Reference>
<Reference
Include=
"Coscine.JwtHandler, Version=1.2.0.0, Culture=neutral, PublicKeyToken=aaacf41df3a6253c, processorArchitecture=MSIL"
>
<HintPath>
..\packages\Coscine.JwtHandler.1.2.0\lib\net461\Coscine.JwtHandler.dll
</HintPath>
</Reference>
<Reference
Include=
"Coscine.Logging, Version=1.3.0.0, Culture=neutral, PublicKeyToken=e1ed402bc3f6525e, processorArchitecture=MSIL"
>
<HintPath>
..\packages\Coscine.Logging.1.3.0-topic-1221-loggi000
1
\lib\net461\Coscine.Logging.dll
</HintPath>
<HintPath>
..\packages\Coscine.Logging.1.3.0-topic-1221-loggi000
3
\lib\net461\Coscine.Logging.dll
</HintPath>
</Reference>
<Reference
Include=
"Coscine.ProxyApi, Version=1.3.0.0, Culture=neutral, processorArchitecture=MSIL"
>
<HintPath>
..\packages\Coscine.ProxyApi.1.3.0\lib\net461\Coscine.ProxyApi.dll
</HintPath>
...
...
This diff is collapsed.
Click to expand it.
src/Pid/packages.config
+
3
−
3
View file @
20a3056b
...
...
@@ -2,11 +2,11 @@
<
packages
>
<
package
id
=
"Consul"
version
=
"0.7.2.6"
targetFramework
=
"net461"
/>
<
package
id
=
"Coscine.Action"
version
=
"1.17.0"
targetFramework
=
"net461"
/>
<
package
id
=
"Coscine.ApiCommons"
version
=
"1.1
1.0
"
targetFramework
=
"net461"
/>
<
package
id
=
"Coscine.ApiCommons"
version
=
"1.1
2.0-topic-1221-loggi0001
"
targetFramework
=
"net461"
/>
<
package
id
=
"Coscine.Configuration"
version
=
"1.5.0"
targetFramework
=
"net461"
/>
<
package
id
=
"Coscine.Database"
version
=
"1.28.0-topic-1221-loggi000
4
"
targetFramework
=
"net461"
/>
<
package
id
=
"Coscine.Database"
version
=
"1.28.0-topic-1221-loggi000
5
"
targetFramework
=
"net461"
/>
<
package
id
=
"Coscine.JwtHandler"
version
=
"1.2.0"
targetFramework
=
"net461"
/>
<
package
id
=
"Coscine.Logging"
version
=
"1.3.0-topic-1221-loggi000
1
"
targetFramework
=
"net461"
/>
<
package
id
=
"Coscine.Logging"
version
=
"1.3.0-topic-1221-loggi000
3
"
targetFramework
=
"net461"
/>
<
package
id
=
"Coscine.ProxyApi"
version
=
"1.3.0"
targetFramework
=
"net461"
/>
<
package
id
=
"EntityFramework"
version
=
"6.4.4"
targetFramework
=
"net461"
/>
<
package
id
=
"linq2db"
version
=
"3.1.1"
targetFramework
=
"net461"
/>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment