Skip to content

Commit

Permalink
changes needed to integrate with AWS and bypass cognito
Browse files Browse the repository at this point in the history
  • Loading branch information
kirklholub committed Oct 19, 2023
1 parent ecec02d commit ffd1101
Show file tree
Hide file tree
Showing 14 changed files with 392 additions and 162 deletions.
29 changes: 29 additions & 0 deletions blmcontacts.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[email protected],David,Tomalak
[email protected],Woody,Roberts
[email protected],Nnauslar,Nnauslar
[email protected],Chaskell,Chaskell
[email protected],Cfdierking,Cfdierking
[email protected],Basil,Newmerzhycky
[email protected],Dborsum,Dborsum
[email protected],Rkrohn,Rkrohn
[email protected],Eugene,Berger
[email protected],Dan,Nietfeld
[email protected],Kirk,Holub
[email protected],Jebb,Stewart
[email protected],Scott,Nahman
[email protected],Curtis,Alexader
[email protected],Bunnypfau,Bunnypfau
[email protected],Mvrencur,Mvrencur
[email protected],Bernadette,Pfau
[email protected],Michael,Vrencur
[email protected],#None,None
[email protected],tomalakd,tomalakd
[email protected],newFirst,Last
[email protected],Linus,Kamb
[email protected],Jamie,Rhome
[email protected],Wallace,Hogsett
[email protected],Taylor,Trogdon
[email protected],Michael,Brennan
[email protected],Pablo,Santos
[email protected],Nathan,Hardin
[email protected],Nreimer,Nreimer
23 changes: 23 additions & 0 deletions db/setup_db2.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
CREATE DATABASE IF NOT EXISTS ssop_dev2;

CREATE ROLE IF NOT EXISTS 'app2_developer';
CREATE ROLE IF NOT EXISTS 'app2_readonly';
CREATE ROLE IF NOT EXISTS 'app2_readwrite';

GRANT ALL ON ssop_dev2.* TO 'app2_developer';
GRANT SELECT ON ssop_dev2.* TO 'app2_readonly';
GRANT INSERT, UPDATE, DELETE ON ssop_dev2.* TO 'app2_readwrite';

#CREATE USER IF NOT EXISTS 'kirkholub'@'localhost' IDENTIFIED BY 'KpwXW8ehnlRIrMLYBBfFeR2';
#CREATE USER IF NOT EXISTS 'ucanread'@'localhost' IDENTIFIED BY 'ppu_X6LHcu7m0L';
#CREATE USER IF NOT EXISTS 'ucanreadwrite'@'localhost' IDENTIFIED BY 'wvqUgFmGU3uyWYhwWI';

GRANT 'app2_developer' TO 'kirkholub'@'localhost';
GRANT 'app2_readonly' TO 'ucanread'@'localhost';
GRANT 'app2_readonly', 'app2_readwrite' TO 'ucanreadwrite'@'localhost';

SET DEFAULT ROLE ALL TO 'kirkholub'@'localhost';
SET DEFAULT ROLE ALL TO 'ucanread'@'localhost';
SET DEFAULT ROLE ALL TO 'ucanreadwrite'@'localhost';

FLUSH PRIVILEGES;
118 changes: 59 additions & 59 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,59 +1,59 @@
aenum==3.1.15
asgiref==3.7.2
backports.zoneinfo==0.2.1
beautifulsoup4==4.12.2
boto3==1.28.28
botocore==1.31.28
bs4==0.0.1
certifi==2023.7.22
cffi==1.15.1
charset-normalizer==3.1.0
contourpy==1.1.0
cryptography==41.0.1
cycler==0.11.0
diagrams==0.23.3
Django==4.2.2
django-extensions==3.2.3
fonttools==4.40.0
graphviz==0.20.1
gunicorn==20.1.0
idna==3.4
importlib-resources==5.12.0
isodate==0.6.1
jdcal==1.4.1
Jinja2==3.1.2
jmespath==1.0.1
kiwisolver==1.4.4
lxml==4.9.2
MarkupSafe==2.1.3
matplotlib==3.7.1
mysql-connector-python==8.0.33
mysqlclient==2.2.0
networkx==3.1
numpy==1.25.0
oauthlib==3.2.2
onelogin==3.1.4
packaging==23.1
Pillow==9.5.0
protobuf==3.20.3
pyclean==2.7.3
pycparser==2.21
pydantic==1.10.9
pydot==1.4.2
PyJWT==2.7.0
pyOpenSSL==23.2.0
pyparsing==3.1.0
python-dateutil==2.8.2
python3-saml==1.15.0
pytz==2023.3
requests==2.31.0
requests-oauthlib==1.3.1
s3transfer==0.6.1
six==1.16.0
soupsieve==2.4.1
sqlparse==0.4.4
typed-ast==1.5.4
typing_extensions==4.6.3
urllib3==1.26.16
xmlsec==1.3.13
zipp==3.15.0
aenum
asgiref
backports.zoneinfo
beautifulsoup4
boto3
botocore
bs4
certifi
cffi
charset-normalizer
contourpy
cryptography
cycler
diagrams
Django
django-extensions
fonttools
graphviz
gunicorn
idna
importlib-resources
isodate
jdcal
Jinja2
jmespath
kiwisolver
lxml
MarkupSafe
matplotlib
mysql-connector-python
mysqlclient
networkx
numpy
oauthlib
onelogin
packaging
Pillow
protobuf
pyclean
pycparser
pydantic
pydot
PyJWT
pyOpenSSL
pyparsing
python-dateutil
python3-saml
pytz
requests
requests-oauthlib
s3transfer
six
soupsieve
sqlparse
typed-ast
typing_extensions
urllib3
xmlsec
zipp
2 changes: 1 addition & 1 deletion sites/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class OrganizationAdmin(admin.ModelAdmin):

class ProjectAdmin(admin.ModelAdmin):
#list_display = ('name', 'organization', 'enabled', 'expiretokens', 'return_to', 'queryparam', 'error_redirect', 'display_order', 'state', 'decrypt_key', 'graph_node_id')
list_display = ('name', 'organization', 'enabled', 'expiretokens', 'queryparam', 'return_to', 'error_redirect', 'contacts_url', 'users', 'decrypt_key', 'state', 'logoimg', 'showlogobin', 'display_order', 'state', 'decrypt_key', 'updated')
list_display = ('name', 'organization', 'enabled', 'expiretokens', 'queryparam', 'return_to', 'error_redirect', 'contacts_url', 'users', 'app_params', 'decrypt_key', 'state', 'logoimg', 'showlogobin', 'display_order', 'state', 'decrypt_key', 'updated')
list_display_links = list_display
#readonly_fields = ('state', 'updater')
ordering = ('display_order', 'organization', 'name')
Expand Down
2 changes: 1 addition & 1 deletion sites/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class ProjectAdminForm(forms.ModelForm):
class Meta:
model = Project
#fields = '__all__'
field_order = ('name', 'organization', 'verbose_name', 'return_to', 'error_redirect', 'enabled', 'display_order', 'decrypt_key', 'logoimg', 'userlist', 'expiretokens', 'graphnode', 'state', 'queryparam', 'querydelimiter', )
field_order = ('name', 'organization', 'verbose_name', 'return_to', 'error_redirect', 'enabled', 'display_order', 'decrypt_key', 'logoimg', 'userlist', 'app_params', 'expiretokens', 'graphnode', 'state', 'queryparam', 'querydelimiter', )
fields = field_order


Expand Down
27 changes: 27 additions & 0 deletions sites/management/commands/add_contacts_list.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
"""
Add a list of ontacts if they do not exits. This placeholder is required to make the GUI happy.
"""
from __future__ import unicode_literals


# https://stackoverflow.com/questions/19475955/using-django-models-in-external-python-script
from django.core.management.base import BaseCommand

from sites.models import add_contacts_list

class Command(BaseCommand):
help = "adds a list of Contacts from a list of email, fistname, lastname"

def add_arguments(self, parser):
parser.add_argument('filename', type=str)

def handle(self, *args, **options):

filename = options['filename']
print('filename: ' + filename)

fp = open(filename, 'r')
userlist = fp.read()
fp.close
add_contacts_list(userlist)

29 changes: 29 additions & 0 deletions sites/management/commands/contacts_list.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
| [email protected] | David | Tomalak |
| [email protected] | Woody | Roberts |
| [email protected] | Nnauslar | Nnauslar |
| [email protected] | Chaskell | Chaskell |
| [email protected] | Cfdierking | Cfdierking |
| [email protected] | Basil | Newmerzhycky |
| [email protected] | Dborsum | Dborsum |
| [email protected] | Rkrohn | Rkrohn |
| [email protected] | Eugene | Berger |
| [email protected] | Dan | Nietfeld |
| [email protected] | Kirk | Holub |
| [email protected] | Jebb | Stewart |
| [email protected] | Scott | Nahman |
| [email protected] | Curtis | Alexader |
| [email protected] | Bunnypfau | Bunnypfau |
| [email protected] | Mvrencur | Mvrencur |
| [email protected] | Bernadette | Pfau |
| [email protected] | Michael | Vrencur |
| [email protected] | #None | None |
| [email protected] | tomalakd | tomalakd |
| [email protected] | newFirst | Last |
| [email protected] | Linus | Kamb |
| [email protected] | Jamie | Rhome |
| [email protected] | Wallace | Hogsett |
| [email protected] | Taylor | Trogdon |
| [email protected] | Michael | Brennan |
| [email protected] | Pablo | Santos |
| [email protected] | Nathan | Hardin |
| [email protected] | Nreimer | Nreimer |
17 changes: 17 additions & 0 deletions sites/management/commands/copy_gsl_packs_and_apps.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# https://stackoverflow.com/questions/19475955/using-django-models-in-external-python-script
from django.core.management.base import BaseCommand
import secrets

class Command(BaseCommand):
help = "generates a random token of a given length; default=64"

def add_arguments(self, parser):
parser.add_argument('len', type=int)

def handle(self, *args, **options):

tokenlen = options['len']
token = secrets.token_urlsafe(tokenlen)
print(token)


Loading

0 comments on commit ffd1101

Please sign in to comment.