Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
G
gracedb
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
91
Issues
91
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Security & Compliance
Security & Compliance
Dependency List
Packages
Packages
Container Registry
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lscsoft
gracedb
Commits
962da408
Commit
962da408
authored
Aug 06, 2019
by
Tanner Prestegard
Committed by
GraceDB
Aug 06, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ligoauth: add new X.509 certificate for emfollow acct
parent
1d2a1ea7
Pipeline
#73748
passed with stages
in 12 minutes and 48 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
42 additions
and
0 deletions
+42
-0
gracedb/ligoauth/migrations/0047_add_emfollow_cert.py
gracedb/ligoauth/migrations/0047_add_emfollow_cert.py
+42
-0
No files found.
gracedb/ligoauth/migrations/0047_add_emfollow_cert.py
0 → 100644
View file @
962da408
# -*- coding: utf-8 -*-
# Generated by Django 1.11.20 on 2019-08-06 18:06
from
__future__
import
unicode_literals
from
django.db
import
migrations
ACCOUNT
=
{
'name'
:
'emfollow'
,
'new_cert'
:
'/DC=org/DC=cilogon/C=US/O=LIGO/OU=Robots/CN=emfollow-playground.ligo.caltech.edu/CN=emfollow-playground/CN=Leo Singer/CN=UID:leo.singer.robot'
}
def
add_cert
(
apps
,
schema_editor
):
User
=
apps
.
get_model
(
'auth'
,
'User'
)
# Get user
user
=
User
.
objects
.
get
(
username
=
ACCOUNT
[
'name'
])
# Create new certificate
user
.
x509cert_set
.
create
(
subject
=
ACCOUNT
[
'new_cert'
])
def
delete_cert
(
apps
,
schema_editor
):
User
=
apps
.
get_model
(
'auth'
,
'User'
)
# Get user
user
=
User
.
objects
.
get
(
username
=
ACCOUNT
[
'name'
])
# Delete new certificate
cert
=
user
.
x509cert_set
.
get
(
subject
=
ACCOUNT
[
'new_cert'
])
cert
.
delete
()
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'ligoauth'
,
'0046_delete_robotuser_model'
),
]
operations
=
[
migrations
.
RunPython
(
add_cert
,
delete_cert
),
]
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment