Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
GraceDB Server
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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 GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Michael William Coughlin
GraceDB Server
Commits
4e63cc0b
Commit
4e63cc0b
authored
6 years ago
by
Tanner Prestegard
Committed by
GraceDB
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add new robot certificates for 'emfollow' account
parent
38632f93
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gracedb/ligoauth/migrations/0025_update_emfollow_certs.py
+49
-0
49 additions, 0 deletions
gracedb/ligoauth/migrations/0025_update_emfollow_certs.py
with
49 additions
and
0 deletions
gracedb/ligoauth/migrations/0025_update_emfollow_certs.py
0 → 100644
+
49
−
0
View file @
4e63cc0b
# -*- coding: utf-8 -*-
# Generated by Django 1.11.18 on 2019-03-01 14:37
from
__future__
import
unicode_literals
from
django.db
import
migrations
USERNAME
=
'
emfollow
'
NEW_CERTS
=
[
'
/DC=org/DC=cilogon/C=US/O=LIGO/OU=Robots/CN=emfollow.ligo.caltech.edu/CN=emfollow/CN=Leo Singer/CN=UID:leo.singer.robot
'
,
'
/DC=org/DC=cilogon/C=US/O=LIGO/OU=Robots/CN=emfollow.ligo-la.caltech.edu/CN=emfollow-la/CN=Leo Singer/CN=UID:leo.singer.robot
'
,
'
/DC=org/DC=cilogon/C=US/O=LIGO/OU=Robots/CN=emfollow.ligo-wa.caltech.edu/CN=emfollow-wa/CN=Leo Singer/CN=UID:leo.singer.robot
'
,
'
/DC=org/DC=cilogon/C=US/O=LIGO/OU=Robots/CN=emfollow.ligo.caltech.edu/CN=emfollow-playground/CN=Leo Singer/CN=UID:leo.singer.robot
'
,
'
/DC=org/DC=cilogon/C=US/O=LIGO/OU=Robots/CN=emfollow.ligo-la.caltech.edu/CN=emfollow-playground-la/CN=Leo Singer/CN=UID:leo.singer.robot
'
,
'
/DC=org/DC=cilogon/C=US/O=LIGO/OU=Robots/CN=emfollow.ligo-wa.caltech.edu/CN=emfollow-playground-wa/CN=Leo Singer/CN=UID:leo.singer.robot
'
,
]
def
update_certs
(
apps
,
schema_editor
):
RobotUser
=
apps
.
get_model
(
'
ligoauth
'
,
'
RobotUser
'
)
# Get user
user
=
RobotUser
.
objects
.
get
(
username
=
USERNAME
)
# Create new certificates for user
for
cert
in
NEW_CERTS
:
user
.
x509cert_set
.
create
(
subject
=
cert
)
def
revert_certs
(
apps
,
schema_editor
):
RobotUser
=
apps
.
get_model
(
'
ligoauth
'
,
'
RobotUser
'
)
# Get user
user
=
RobotUser
.
objects
.
get
(
username
=
USERNAME
)
# Delete certificates for user
for
cert
in
NEW_CERTS
:
user
.
x509cert_set
.
get
(
subject
=
cert
).
delete
()
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'
ligoauth
'
,
'
0024_create_gwhen_account_and_certs
'
),
]
operations
=
[
migrations
.
RunPython
(
update_certs
,
revert_certs
),
]
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