Skip to content

Commit 07db2d1

Browse files
authored
Merge pull request #98 from browserstack/refactor_templates
refactor: renaming templates to enigmaops
2 parents 4a1d60c + 24b2ca2 commit 07db2d1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+15897
-58
lines changed

Access/background_task_manager.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,7 @@ def run_accept_request(data):
300300

301301

302302
def accept_request(user_access_mapping):
303+
result = None
303304
try:
304305
result = run_access_grant.delay(user_access_mapping.request_id)
305306
except Exception:

Access/models.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -855,6 +855,7 @@ def decline_access(self, decline_reason=None):
855855
self.decline_reason = decline_reason
856856
self.save()
857857

858+
@staticmethod
858859
def get_pending_access_mapping(request_id):
859860
return UserAccessMapping.objects.filter(
860861
request_id__contains=request_id, status__in=["Pending", "SecondaryPending"]

Access/views.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ def accept_bulk(request, selector):
390390
json_response = {}
391391
json_response["error"] = INVALID_REQUEST_MESSAGE
392392
json_response["success"] = False
393-
return JsonResponse(json_response, status=401)
393+
return JsonResponse(json_response, status=400)
394394

395395

396396
def _get_request_ids_for_bulk_processing(posted_request_ids, selector):
@@ -418,6 +418,7 @@ def _get_request_ids_for_bulk_processing(posted_request_ids, selector):
418418
selector = "groupAccess"
419419
else:
420420
access_request_ids = input_vals
421+
logger.debug("Got the ids %s for bulk processing" % (",".join(access_request_ids)))
421422
return access_request_ids, return_ids, selector
422423

423424

EnigmaAutomation/settings.py

Lines changed: 17 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -212,12 +212,15 @@
212212
"PASSWORD": data["database"]["password"],
213213
"HOST": data["database"]["host"],
214214
"PORT": data["database"]["port"],
215-
"OPTIONS": {"auth_plugin": "mysql_native_password"},
215+
'OPTIONS': {
216+
"auth_plugin": "mysql_native_password",
217+
'charset': 'utf8mb4',
218+
}
216219
}
217220
elif data["database"]["engine"] == "sqlite3":
218221
DATABASES["default"] = {
219222
"ENGINE": "django.db.backends.sqlite3",
220-
"NAME": BASE_DIR / "db.sqlite3",
223+
"NAME": BASE_DIR / "db/db.sqlite3",
221224
}
222225
else:
223226
raise Exception("Database engine %s not recognized" % data["database"]["engine"])
@@ -233,6 +236,8 @@
233236

234237
AUTOMATED_EXEC_IDENTIFIER = "automated-grant"
235238

239+
current_log_level = 'DEBUG'
240+
logging_apps = ["django.request", "inventory", "Access", "bootprocess"]
236241
LOGGING = {
237242
'version': 1,
238243
'disable_existing_loggers': False,
@@ -244,41 +249,23 @@
244249
},
245250
'handlers': {
246251
'file': {
247-
'level': 'INFO',
252+
'level': current_log_level,
248253
'class': 'logging.FileHandler',
249254
'filename': './enigma.log',
250255
'formatter': 'verbose',
251256
},
252257
"console": {
253-
"level": "INFO",
258+
"level": current_log_level,
254259
"class": "logging.StreamHandler",
255260
"formatter": "verbose",
256261
},
257262
},
258-
"loggers": {
259-
"django.request": {
260-
"handlers": ["file", "console"],
261-
"level": "INFO",
262-
"propagate": True,
263-
"formatter": "verbose",
264-
},
265-
"inventory": {
266-
"handlers": ["file", "console"],
267-
"level": "INFO",
268-
"propagate": True,
269-
"formatter": "verbose",
270-
},
271-
"Access": {
272-
"handlers": ["file", "console"],
273-
"level": "INFO",
274-
"propagate": True,
275-
"formatter": "verbose",
276-
},
277-
"bootprocess": {
278-
"handlers": ["file", "console"],
279-
"level": "INFO",
280-
"propagate": True,
281-
"formatter": "verbose",
282-
},
283-
},
263+
"loggers": { },
284264
}
265+
for each_app in logging_apps:
266+
LOGGING["loggers"][each_app] = {
267+
"handlers": ["file", "console"],
268+
"level": current_log_level,
269+
"propagate": True,
270+
"formatter": "verbose",
271+
}

docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ services:
1111
- ./secrets/ops_app_dev.env
1212
volumes:
1313
- ./mounts/logs/:/ebs/logs/
14+
- ./mounts/db/:/srv/code/dev/db/
1415
ports:
1516
- 8000:8000
1617
depends_on:

static/background.jpg

761 KB
Loading

static/css/custom.css

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
/* your styles go here */
2+
3+
.row {
4+
margin:0px;
5+
padding:1%;
6+
}
7+
8+
.heading {
9+
color:#1AC98E !important;
10+
}
11+
12+
.form-text1 {
13+
height: calc(2.4rem + 2px);
14+
background: transparent;
15+
padding: 0.45rem 0.75rem;
16+
display:inline-block;
17+
}
18+
/* i{
19+
color:white !important;
20+
} */
21+
22+
input[type=text], input[type=number]{
23+
background-color: inherit;
24+
border: 1px solid #8a8d93;
25+
color: #8a8d93;
26+
}
27+
28+
input {
29+
border-radius: 5px !important;
30+
}
31+
32+
i.nav-icon{
33+
color:white !important;
34+
}
35+
36+
.tablesorter-filter-row {
37+
background-color: transparent !important;
38+
}
39+
40+
.tablesorter-filter{
41+
background-color: transparent !important;
42+
color: white !important;
43+
}
44+
45+
.tablesorter-header{
46+
color:#1AC98E !important;
47+
}
48+
/* .form-control {
49+
border:1px solid white !important;
50+
color: white;
51+
} */
52+
/* nav#sidebar li.active > a {
53+
color: white !important;
54+
} */
55+
56+
h2 {
57+
color:#1AC98E !important;
58+
}
59+
60+
/* label {
61+
color:#FFFFFF !important;
62+
} */
63+
64+
/* tbody {
65+
color: white !important;
66+
} */
67+
68+
.table-bordered {
69+
border:none !important;
70+
}
71+
72+
.ts-pager {
73+
background-color: transparent !important;
74+
}
75+
76+
.generic-access-modal {
77+
width: 80%;
78+
max-width: 80%;
79+
}
80+
81+
.generic-access-modal-body > select {
82+
height: 100%;
83+
width: 200px;
84+
}
85+
86+
.generic-access-select-wrapper {
87+
float: left;
88+
width: 80%;
89+
}
90+
91+
.generic-access-form-submit {
92+
float: right;
93+
width: 100px;
94+
}
95+
96+
.modal-content {
97+
margin-top: 150px;
98+
}
99+
100+
#newGroupMember #selectedGroup {
101+
width: 70%;
102+
}
103+
104+
#newGroupMember .labelDiv {
105+
float: left;
106+
margin-right: 20px;
107+
}
108+
109+
#groupAccess .labelDiv {
110+
float: left;
111+
margin-right: 20px;
112+
}
113+
114+
#groupAccess .selectDiv {
115+
float: right;
116+
width: 70%;
117+
}
118+
119+
#groupAccess #group {
120+
width: 70%;
121+
}
122+
123+
.groupAccessModal {
124+
width: 80%;
125+
max-width: 80%;
126+
}
127+
128+
.groupAccessModal .contentDiv {
129+
width: 80%;
130+
max-width: 80%;
131+
padding-bottom: 60px;
132+
}
133+
134+
.groupAccessModal select {
135+
height: 100%;
136+
}
137+
138+
.vaultRequest.accessKey {
139+
display: none;
140+
}
141+
142+
.vaultRequest.addNewComponent {
143+
display: none;
144+
}

static/css/group_list.css

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
.tab-content .tab-pane {
2+
max-width: 90%;
3+
}
4+
5+
body{
6+
overflow: visible;
7+
}
8+
9+
select.tablesorter-filter{
10+
display: block;
11+
}
12+
13+
input[type='search'].tablesorter-filter{
14+
background: white;
15+
}
16+
17+
.col.s12{
18+
padding: 0px;
19+
}

static/css/jquery-ui.min.css

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
/* pager wrapper, div */
2+
.tablesorter-pager {
3+
padding: 5px;
4+
}
5+
/* pager wrapper, in thead/tfoot */
6+
td.tablesorter-pager {
7+
background-color: #e6eeee;
8+
margin: 0; /* needed for bootstrap .pager gets a 18px bottom margin */
9+
}
10+
/* pager navigation arrows */
11+
.tablesorter-pager img {
12+
vertical-align: middle;
13+
margin-right: 2px;
14+
cursor: pointer;
15+
}
16+
17+
/* pager output text */
18+
.tablesorter-pager .pagedisplay {
19+
padding: 0 5px 0 5px;
20+
width: auto;
21+
white-space: nowrap;
22+
text-align: center;
23+
}
24+
25+
/* pager element reset (needed for bootstrap) */
26+
.tablesorter-pager select {
27+
margin: 0;
28+
padding: 0;
29+
}
30+
31+
/*** css used when "updateArrows" option is true ***/
32+
/* the pager itself gets a disabled class when the number of rows is less than the size */
33+
.tablesorter-pager.disabled {
34+
display: none;
35+
}
36+
/* hide or fade out pager arrows when the first or last row is visible */
37+
.tablesorter-pager .disabled {
38+
/* visibility: hidden */
39+
opacity: 0.5;
40+
filter: alpha(opacity=50);
41+
cursor: default;
42+
}

0 commit comments

Comments
 (0)