Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to JiHu GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Chenhao Ma
core
Commits
ee16966f
Commit
ee16966f
authored
7 years ago
by
Harsha Kethineni
Browse files
Options
Downloads
Patches
Plain Diff
access log query project filter added
parent
d014e7cc
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
api/handlers/reporthandler.py
+4
-0
4 additions, 0 deletions
api/handlers/reporthandler.py
bin/log_csv.py
+2
-0
2 additions, 0 deletions
bin/log_csv.py
with
6 additions
and
0 deletions
api/handlers/reporthandler.py
+
4
−
0
View file @
ee16966f
...
...
@@ -505,6 +505,7 @@ class AccessLogReport(Report):
uid
=
params
.
get
(
'
user
'
)
limit
=
params
.
get
(
'
limit
'
,
100
)
subject
=
params
.
get
(
'
subject
'
,
None
)
project
=
parmas
.
get
(
'
project
'
,
None
)
access_types
=
params
.
getall
(
'
access_type
'
)
if
start_date
:
...
...
@@ -532,6 +533,7 @@ class AccessLogReport(Report):
self
.
uid
=
uid
self
.
limit
=
limit
self
.
subject
=
subject
self
.
project
=
project
self
.
access_types
=
access_types
def
user_can_generate
(
self
,
uid
):
...
...
@@ -555,6 +557,8 @@ class AccessLogReport(Report):
query
[
'
timestamp
'
][
'
$lte
'
]
=
self
.
end_date
if
self
.
subject
:
query
[
'
context.subject.label
'
]
=
self
.
subject
if
self
.
project
:
query
[
'
context.project.id
'
]
=
self
.
project
if
self
.
access_types
:
query
[
'
access_type
'
]
=
{
'
$in
'
:
self
.
access_types
}
...
...
This diff is collapsed.
Click to expand it.
bin/log_csv.py
+
2
−
0
View file @
ee16966f
...
...
@@ -22,6 +22,7 @@ ARG_TO_PARAMS= {
'
e
'
:
'
end_date
'
,
'
u
'
:
'
uid
'
,
'
j
'
:
'
subject
'
,
'
p
'
:
'
project
'
,
'
t
'
:
'
access_types
'
}
...
...
@@ -71,6 +72,7 @@ if __name__ == '__main__':
parser
.
add_argument
(
"
-u
"
,
help
=
"
User id
"
,
type
=
str
)
parser
.
add_argument
(
"
-l
"
,
help
=
"
Limit
"
,
type
=
str
)
parser
.
add_argument
(
"
-j
"
,
help
=
"
subJect
"
,
type
=
str
)
parser
.
add_argument
(
"
-p
"
,
help
=
"
project
"
,
type
=
str
)
parser
.
add_argument
(
"
-t
"
,
help
=
"
list of access Types
"
,
type
=
str
,
nargs
=
'
+
'
)
args
=
vars
(
parser
.
parse_args
())
...
...
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