Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Sign in
Toggle navigation
R
red-ci-cd
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
red-group-test
red-ci-cd
Commits
d1b9d732
Commit
d1b9d732
authored
Jul 10, 2019
by
Gladys Forte
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of
http://42.61.118.105:7990/scm/rms/api-main-service
into gladys-develop
parents
2c293c7f
4bed503c
Changes
18
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
497 additions
and
190 deletions
+497
-190
Dockerfile
Dockerfile
+2
-1
api/migrations/0004_auto_20190619_0952.py
api/migrations/0004_auto_20190619_0952.py
+18
-0
api/migrations/0005_auto_20190619_1012.py
api/migrations/0005_auto_20190619_1012.py
+18
-0
api/migrations/0006_auto_20190619_1524.py
api/migrations/0006_auto_20190619_1524.py
+18
-0
api/migrations/0007_auto_20190619_1555.py
api/migrations/0007_auto_20190619_1555.py
+18
-0
api/models.py
api/models.py
+4
-4
api/serializers.py
api/serializers.py
+24
-33
api/urls.py
api/urls.py
+8
-5
api/utils.py
api/utils.py
+49
-13
api/views.py
api/views.py
+7
-6
api/viewsets/applications.py
api/viewsets/applications.py
+63
-28
api/viewsets/endpoints.py
api/viewsets/endpoints.py
+120
-47
api/viewsets/services.py
api/viewsets/services.py
+130
-47
config/settings/local.py
config/settings/local.py
+2
-2
config/settings/production.py
config/settings/production.py
+1
-0
config/settings/uat.py
config/settings/uat.py
+2
-1
docker-compose.yml
docker-compose.yml
+13
-3
requirements/local.txt
requirements/local.txt
+0
-0
No files found.
Dockerfile
View file @
d1b9d732
...
...
@@ -5,4 +5,5 @@ ADD . /code
COPY
. /code
WORKDIR
/code
RUN
pip
install
-r
requirements/local.txt
EXPOSE
9080
EXPOSE
7010
RUN
python manage.py migrate
api/migrations/0004_auto_20190619_0952.py
0 → 100644
View file @
d1b9d732
# Generated by Django 2.1.5 on 2019-06-19 09:52
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'api'
,
'0003_application_code'
),
]
operations
=
[
migrations
.
AlterField
(
model_name
=
'application'
,
name
=
'theme'
,
field
=
models
.
IntegerField
(
default
=
1
),
),
]
api/migrations/0005_auto_20190619_1012.py
0 → 100644
View file @
d1b9d732
# Generated by Django 2.1.5 on 2019-06-19 10:12
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'api'
,
'0004_auto_20190619_0952'
),
]
operations
=
[
migrations
.
AlterField
(
model_name
=
'application'
,
name
=
'theme'
,
field
=
models
.
IntegerField
(
blank
=
True
,
default
=
1
,
null
=
True
),
),
]
api/migrations/0006_auto_20190619_1524.py
0 → 100644
View file @
d1b9d732
# Generated by Django 2.1.5 on 2019-06-19 15:24
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'api'
,
'0005_auto_20190619_1012'
),
]
operations
=
[
migrations
.
AlterField
(
model_name
=
'application'
,
name
=
'theme'
,
field
=
models
.
IntegerField
(
blank
=
True
,
default
=
1
),
),
]
api/migrations/0007_auto_20190619_1555.py
0 → 100644
View file @
d1b9d732
# Generated by Django 2.1.5 on 2019-06-19 15:55
from
django.db
import
migrations
,
models
class
Migration
(
migrations
.
Migration
):
dependencies
=
[
(
'api'
,
'0006_auto_20190619_1524'
),
]
operations
=
[
migrations
.
AlterField
(
model_name
=
'application'
,
name
=
'theme'
,
field
=
models
.
IntegerField
(
default
=
1
),
),
]
api/models.py
View file @
d1b9d732
...
...
@@ -3,9 +3,9 @@ from django.utils import timezone
class
Application
(
models
.
Model
):
application_no
=
models
.
CharField
(
max_length
=
250
)
application_no
=
models
.
CharField
(
max_length
=
250
)
name
=
models
.
CharField
(
max_length
=
200
,
unique
=
True
)
theme
=
models
.
IntegerField
()
theme
=
models
.
IntegerField
(
default
=
1
)
code
=
models
.
CharField
(
max_length
=
300
)
created_at
=
models
.
DateTimeField
(
auto_now_add
=
True
)
updated_at
=
models
.
DateTimeField
(
auto_now
=
True
)
...
...
@@ -14,7 +14,7 @@ class Application(models.Model):
def
delete
(
self
):
self
.
deleted_at
=
timezone
.
now
()
self
.
save
()
def
__str__
(
self
):
return
self
.
name
...
...
@@ -60,7 +60,7 @@ class APIEndpoint(models.Model):
def
delete
(
self
):
self
.
deleted_at
=
timezone
.
now
()
self
.
save
()
def
__str__
(
self
):
return
self
.
name
...
...
api/serializers.py
View file @
d1b9d732
from
rest_framework
import
serializers
from
.models
import
APIService
,
APIEndpoint
,
Application
from
api.utils
import
BadRequestException
,
number_generator
from
api.utils
import
BadRequestException
from
rest_framework.exceptions
import
ValidationError
from
django.utils.crypto
import
get_random_string
from
django.conf
import
settings
ACCOUNT_GROUP
=
settings
.
ACCOUNT_GROUP
class
GroupDependentSerializer
(
serializers
.
ModelSerializer
):
class
Meta
:
model
=
Application
fields
=
(
'id'
,
'name'
,
'code'
)
class
ApplicationSerializer
(
serializers
.
ModelSerializer
):
...
...
@@ -43,7 +45,7 @@ class ApplicationSerializer(serializers.ModelSerializer):
else
:
self
.
_errors
=
{}
#if validation failed
#
if validation failed
if
self
.
_errors
and
raise_exception
:
error_message
=
{}
message
=
str
(
self
.
errors
)
...
...
@@ -60,19 +62,19 @@ class ApplicationSerializer(serializers.ModelSerializer):
return
not
bool
(
self
.
_errors
)
def
create
(
self
,
validated_data
):
new_application
=
Application
.
objects
.
create
(
**
validated_data
)
new_application
.
application_no
=
number_generator
(
'APP'
,
new_application
.
id
)
new_application
.
save
()
return
new_application
class
APIServiceSerializer
(
serializers
.
ModelSerializer
):
class
Meta
:
model
=
APIService
fields
=
(
'id'
,
'api_service_no'
,
'name'
,
'service_token'
,
'base_url'
,
'service_url'
,
'application'
,
'created_at'
,
'updated_at'
,
'deleted_at'
)
read_only_fields
=
(
'id'
,
'api_service_no'
,
'service_token'
,
'created_at'
,
'updated_at'
,
'deleted_at'
)
fields
=
(
'id'
,
'api_service_no'
,
'name'
,
'service_token'
,
'base_url'
,
'service_url'
,
'application'
,
'created_at'
,
'updated_at'
,
'deleted_at'
)
read_only_fields
=
(
'id'
,
'api_service_no'
,
'service_token'
,
'created_at'
,
'updated_at'
,
'deleted_at'
)
def
is_valid
(
self
,
raise_exception
=
False
):
...
...
@@ -97,7 +99,7 @@ class APIServiceSerializer(serializers.ModelSerializer):
else
:
self
.
_errors
=
{}
#if validation failed
#
if validation failed
if
self
.
_errors
and
raise_exception
:
error_message
=
{}
message
=
str
(
self
.
errors
)
...
...
@@ -114,24 +116,19 @@ class APIServiceSerializer(serializers.ModelSerializer):
return
not
bool
(
self
.
_errors
)
def
create
(
self
,
validated_data
):
new_service
=
APIService
.
objects
.
create
(
**
validated_data
)
new_service
.
api_service_no
=
number_generator
(
'SVC'
,
new_service
.
id
)
new_service
.
service_token
=
get_random_string
(
length
=
16
)
new_service
.
save
()
return
new_service
class
APIEndpointSerializer
(
serializers
.
ModelSerializer
):
service_name
=
serializers
.
ReadOnlyField
(
source
=
'service.name'
)
class
Meta
:
model
=
APIEndpoint
fields
=
(
'id'
,
'api_endpoint_no'
,
'service'
,
'service_name'
,
'name'
,
'description'
,
'http_method'
,
'endpoint_url'
,
'is_need_auth'
,
'is_active'
,
'created_at'
,
'updated_at'
,
'deleted_at'
'id'
,
'api_endpoint_no'
,
'service'
,
'name'
,
'description'
,
'http_method'
,
'endpoint_url'
,
'is_need_auth'
,
'is_active'
,
'created_at'
,
'updated_at'
,
'deleted_at'
)
read_only_fields
=
(
'id'
,
'api_endpoint_no'
,
'created_at'
,
'updated_at'
,
'deleted_at'
)
read_only_fields
=
(
'id'
,
'api_endpoint_no'
,
'created_at'
,
'updated_at'
,
'deleted_at'
)
def
is_valid
(
self
,
raise_exception
=
False
):
...
...
@@ -156,7 +153,7 @@ class APIEndpointSerializer(serializers.ModelSerializer):
else
:
self
.
_errors
=
{}
#if validation failed
#
if validation failed
if
self
.
_errors
and
raise_exception
:
error_message
=
{}
message
=
str
(
self
.
errors
)
...
...
@@ -172,9 +169,3 @@ class APIEndpointSerializer(serializers.ModelSerializer):
raise
BadRequestException
(
error_message
)
return
not
bool
(
self
.
_errors
)
def
create
(
self
,
validated_data
):
new_endpoint
=
APIEndpoint
.
objects
.
create
(
**
validated_data
)
new_endpoint
.
api_endpoint_no
=
number_generator
(
'ENP'
,
new_endpoint
.
id
)
new_endpoint
.
save
()
return
new_endpoint
api/urls.py
View file @
d1b9d732
from
api.viewsets.applications
import
ApplicationViewSet
from
api.viewsets.services
import
APIServiceViewSet
from
api.viewsets.endpoints
import
APIEndpointViewSet
from
django.urls
import
path
,
include
from
rest_framework.routers
import
DefaultRouter
,
SimpleRouter
from
rest_framework.routers
import
DefaultRouter
from
api.viewsets.services
import
APIServiceViewSet
from
api.viewsets.endpoints
import
APIEndpointViewSet
from
api.viewsets.applications
import
(
ApplicationViewSet
,
MainApplicationViewSet
)
from
api.views
import
(
APIGatewayList
,
APIGatewaySlugDetail
,
APIGatewaySlugModelDetail
)
...
...
@@ -10,7 +12,8 @@ from api.views import (
router
=
DefaultRouter
()
router
.
register
(
r'applications'
,
ApplicationViewSet
)
router
.
register
(
r'services'
,
APIServiceViewSet
)
router
.
register
(
r'endpoint'
,
APIEndpointViewSet
)
router
.
register
(
r'endpoints'
,
APIEndpointViewSet
)
router
.
register
(
r'main-application'
,
MainApplicationViewSet
)
urlpatterns
=
[
path
(
''
,
include
(
router
.
urls
)),
...
...
api/utils.py
View file @
d1b9d732
...
...
@@ -9,13 +9,16 @@ from .models import APIEndpoint
from
rest_framework.pagination
import
PageNumberPagination
from
rest_framework.response
import
Response
import
datetime
from
django.db.models.functions
import
Lower
VALIDATE_TOKEN_URL
=
settings
.
VALIDATE_TOKEN_URL
class
BadRequestException
(
Exception
):
pass
pass
class
APIEndpointFilter
(
FilterSet
):
service
=
filters
.
CharFilter
(
'service__name'
)
...
...
@@ -88,16 +91,29 @@ class Helper:
service__name
=
service
,
endpoint_url
=
endpoint_url
,
)
if
endpoint
.
is_active
is
True
:
base_url
=
endpoint
.
service
.
base_url
full_path
=
request
.
get_full_path
()
final_endpoint
=
f
"{base_url}{full_path}"
if
endpoint
.
is_need_auth
is
True
:
# redirect to authenticator service
self
.
_headers
=
{
'Authorization'
:
request
.
META
[
'HTTP_AUTHORIZATION'
],
"endpoint"
:
endpoint
.
endpoint_url
'Content-Type'
:
'application/json'
,
"endpoint"
:
str
(
endpoint
.
id
)
# "user": str(endpoint.name),
}
# print(endpoint.endpoint_url)
# last = full_path.split('/')
# print(last)
# print(f'{full_path},dddd')
# print(request)
# print(self._headers)
if
endpoint
.
endpoint_url
==
'current-user'
:
return
self
.
_request_method
(
request
,
final_endpoint
,
self
.
_headers
)
req
=
requests
.
post
(
VALIDATE_TOKEN_URL
,
headers
=
self
.
_headers
)
all_headers
=
{
**
req
.
headers
,
**
self
.
_headers
}
...
...
@@ -113,9 +129,11 @@ class Helper:
return
self
.
_request_method
(
request
,
final_endpoint
,
self
.
_headers
)
else
:
return
self
.
_response_data
({
'message'
:
'Invalid'
},
status
.
HTTP_500_INTERNAL_SERVER_ERROR
,
self
.
_headers
)
return
self
.
_response_data
(
{
'message'
:
'Invalid'
},
status
.
HTTP_500_INTERNAL_SERVER_ERROR
,
self
.
_headers
)
except
APIEndpoint
.
DoesNotExist
:
raise
Http404
except
Exception
as
e
:
...
...
@@ -123,9 +141,10 @@ class Helper:
status
.
HTTP_500_INTERNAL_SERVER_ERROR
,
self
.
_headers
)
class
CustomPagination
(
PageNumberPagination
):
page_size
=
5
# Set number of result to display per page
max_page_size
=
50
# Sets max page size that user may request
page_size
=
5
max_page_size
=
50
page_query_param
=
'page'
page_size_query_param
=
'page_size'
...
...
@@ -141,6 +160,7 @@ class CustomPagination(PageNumberPagination):
'results'
:
data
[
'results'
]
})
# autogenerated number
def
number_generator
(
prefix
,
id
):
date
=
'{:
%
Y
%
m
%
d}'
.
format
(
datetime
.
datetime
.
now
())
...
...
@@ -149,13 +169,29 @@ def number_generator(prefix, id):
return
autogenerated_no
# status message
def
status_message_response
(
code
,
status
,
message
,
results
):
message
=
{
'code'
:
code
,
'status'
:
status
,
'message'
:
message
,
'results'
:
results
}
'code'
:
code
,
'status'
:
status
,
'message'
:
message
,
'results'
:
results
}
return
message
# Table ordering
def
tbl_ordering
(
queryset
,
**
kwargs
):
sort_field
=
kwargs
.
get
(
'sort_field'
,
None
)[
0
]
sort_order
=
kwargs
.
get
(
'sort_order'
,
None
)[
0
]
if
sort_order
.
lower
()
==
'asc'
:
queryset
=
queryset
.
order_by
(
Lower
(
sort_field
)
.
asc
())
else
:
queryset
=
queryset
.
order_by
(
Lower
(
sort_field
)
.
desc
())
return
queryset
api/views.py
View file @
d1b9d732
from
rest_framework
import
viewsets
,
status
from
rest_framework.views
import
APIView
from
rest_framework.decorators
import
action
from
rest_framework.response
import
Response
from
django_filters.rest_framework
import
DjangoFilterBackend
from
.models
import
APIService
,
APIEndpoint
,
Application
from
.utils
import
(
APIEndpointFilter
,
Helper
)
from
.utils
import
Helper
class
APIGatewayList
(
APIView
):
...
...
@@ -32,8 +28,13 @@ class APIGatewaySlugDetail(APIView):
def
_response
(
self
,
request
,
**
kwargs
):
service
=
kwargs
.
get
(
'service'
)
endpoint_url
=
kwargs
.
get
(
'endpoint_url'
)
slug
=
kwargs
.
get
(
'slug'
)
if
slug
==
'archived'
:
slug
=
'archived'
else
:
slug
=
'slug'
api
=
Helper
()
.
get_endpoint
(
request
,
service
,
f
"{endpoint_url}/
slug
"
)
request
,
service
,
f
"{endpoint_url}/
{slug}
"
)
return
Response
(
api
[
'data'
],
status
=
api
[
'status_code'
],
headers
=
api
[
'headers'
])
...
...
api/viewsets/applications.py
View file @
d1b9d732
import
requests
# from django.db.models import F
# from django.db.models import OuterRef, Subquery
from
django.conf
import
settings
from
rest_framework
import
viewsets
,
status
from
rest_framework.decorators
import
action
from
rest_framework.response
import
Response
from
api.models
import
Application
from
api.serializers
import
ApplicationSerializer
from
api.utils
import
(
CustomPagination
,
BadRequestException
,
status_message_response
)
from
api.serializers
import
ApplicationSerializer
,
GroupDependentSerializer
from
api.utils
import
(
CustomPagination
,
BadRequestException
,
status_message_response
,
number_generator
,
tbl_ordering
)
from
django_filters.rest_framework
import
DjangoFilterBackend
from
rest_framework.filters
import
SearchFilter
A
CCOUNT_GROUP
=
settings
.
ACCOUNT
_GROUP
A
UTHENTICATOR_GROUP
=
settings
.
AUTHENTICATOR
_GROUP
class
ApplicationViewSet
(
viewsets
.
ModelViewSet
):
...
...
@@ -22,19 +24,28 @@ class ApplicationViewSet(viewsets.ModelViewSet):
queryset
=
Application
.
objects
.
all
()
serializer_class
=
ApplicationSerializer
pagination_class
=
CustomPagination
filter_backends
=
(
DjangoFilterBackend
,
SearchFilter
,)
search_fields
=
(
'application_no'
,
'name'
,
'code'
)
# filter_class = APIEndpointFilter
# CREATE Application
def
create
(
self
,
request
,
*
args
,
**
kwargs
):
try
:
serializer
=
self
.
get_serializer
(
data
=
request
.
data
)
serializer
.
is_valid
(
raise_exception
=
True
)
self
.
perform_create
(
serializer
)
headers
=
self
.
get_success_headers
(
serializer
.
data
)
app_create
=
serializer
.
save
()
# for application_no
app_id
=
app_create
.
pk
app_create
.
application_no
=
number_generator
(
'APP'
,
app_id
)
app_create
.
save
()
message
=
status_message_response
(
201
,
'success'
,
'New application created'
,
serializer
.
data
)
201
,
'success'
,
'New application created'
,
serializer
.
data
)
return
Response
(
message
)
except
BadRequestException
as
e
:
...
...
@@ -43,30 +54,51 @@ class ApplicationViewSet(viewsets.ModelViewSet):
except
Exception
as
e
:
message
=
status_message_response
(
500
,
'failed'
,
'Request was not able to process'
+
str
(
e
),
[]
)
500
,
'failed'
,
'Request was not able to process'
+
str
(
e
),
[]
)
return
Response
(
message
,
status
=
status
.
HTTP_500_INTERNAL_SERVER_ERROR
)
# SHOW LIST of Applications
def
list
(
self
,
request
,
*
args
,
**
kwargs
):
try
:
queryset
=
Application
.
objects
.
filter
(
deleted_at__exact
=
None
)
# queryset = Application.objects.filter(deleted_at__exact=None)
queryset
=
self
.
queryset
.
filter
(
deleted_at__exact
=
None
)
ids
=
self
.
request
.
query_params
.
get
(
'ids'
,
None
)
# table ordering
if
'sort_field'
and
'sort_order'
in
request
.
query_params
:
queryset
=
tbl_ordering
(
queryset
,
**
request
.
query_params
)
queryset
=
self
.
filter_queryset
(
queryset
)
if
not
queryset
.
exists
():
message
=
status_message_response
(
200
,
'success'
,
'No records found'
,
[]
)
return
Response
(
message
)
if
ids
is
not
None
:
ids
=
ids
.
split
(
','
)
queryset
=
queryset
.
filter
(
id__in
=
ids
)
page
=
self
.
paginate_queryset
(
queryset
)
if
page
is
not
None
:
serializer
=
self
.
get_serializer
(
page
,
many
=
True
)
results
=
[]
for
item
in
serializer
.
data
:
ids
=
item
[
'id'
]
req
=
requests
.
get
(
f
'{ACCOUNT_GROUP}/{ids}/'
)
# print(item['code'])
ids
=
item
[
'code'
]
# headers = {
# 'content-type': 'application/json',
# 'Authorization': request.META['HTTP_AUTHORIZATION']
# }
req
=
requests
.
get
(
f
'{AUTHENTICATOR_GROUP}/{ids}/'
)
groups
=
req
.
json
()[
'groups'
]
modules
=
req
.
json
()[
'modules'
]
item
[
'groups'
]
=
groups
item
[
'modules'
]
=
modules
...
...
@@ -91,19 +123,19 @@ class ApplicationViewSet(viewsets.ModelViewSet):
def
retrieve
(
self
,
request
,
*
args
,
**
kwargs
):
try
:
id
=
self
.
kwargs
[
'pk'
]
queryset
=
Application
.
objects
.
filter
(
id
=
id
)
serializer
=
self
.
get_serializer
(
queryset
,
many
=
Tru
e
)
instance
=
Application
.
objects
.
get
(
id
=
id
)
serializer
=
self
.
get_serializer
(
instanc
e
)
if
not
queryset
.
exists
():
message
=
status_message_response
(
404
,
'failed'
,
'No record found'
,
[])
return
Response
(
message
,
status
=
status
.
HTTP_404_NOT_FOUND
)
else
:
message
=
status_message_response
(
message
=
status_message_response
(
200
,
'success'
,
'Application retrieved'
,
serializer
.
data
)
return
Response
(
message
,
status
=
status
.
HTTP_200_OK
)
return
Response
(
message
,
status
=
status
.
HTTP_200_OK
)
except
Application
.
DoesNotExist
:
message
=
status_message_response
(
404
,
'failed'
,
'No record found'
,
[])
return
Response
(
message
,
status
=
status
.
HTTP_404_NOT_FOUND
)
except
Exception
as
e
:
message
=
status_message_response
(
...
...
@@ -158,7 +190,6 @@ class ApplicationViewSet(viewsets.ModelViewSet):
return
Response
(
message
,
status
=
status
.
HTTP_500_INTERNAL_SERVER_ERROR
)
# PATCH - RESTORE archived application
def
partial_update
(
self
,
request
,
*
args
,
**
kwargs
):
try
:
...
...
@@ -181,7 +212,6 @@ class ApplicationViewSet(viewsets.ModelViewSet):
return
Response
(
message
,
status
=
status
.
HTTP_500_INTERNAL_SERVER_ERROR
)
# /archived - show list of archived application
@
action
(
methods
=
[
"GET"
],
detail
=
False
)
def
archived
(
self
,
request
,
pk
=
None
):
...
...
@@ -238,3 +268,8 @@ class ApplicationViewSet(viewsets.ModelViewSet):
)
return
Response
(
message
,
status
=
status
.
HTTP_500_INTERNAL_SERVER_ERROR
)
class
MainApplicationViewSet
(
viewsets
.
ModelViewSet
):
queryset
=
Application
.
objects
.
all
()
serializer_class
=
GroupDependentSerializer
api/viewsets/endpoints.py
View file @
d1b9d732
This diff is collapsed.
Click to expand it.
api/viewsets/services.py
View file @
d1b9d732
This diff is collapsed.
Click to expand it.
config/settings/local.py
View file @
d1b9d732
...
...
@@ -32,5 +32,5 @@ DATABASES = {
AUTHENTICATOR_IP
=
config
[
'SERVICE'
][
'AUTHENTICATOR_IP'
]
AUTHENTICATOR_PATH
=
'/api/v1/authenticator'
VALIDATE_TOKEN_URL
=
f
'http://{AUTHENTICATOR_IP}{AUTHENTICATOR_PATH}/validate-token/'
A
CCOUNT_GROUP
=
f
'http://{AUTHENTICATOR_IP}{AUTHENTICATOR_PATH}/account-dependent
'
VALIDATE_TOKEN_URL
=
f
'http://{AUTHENTICATOR_IP}{AUTHENTICATOR_PATH}/
authenticator-
validate-token/'
A
UTHENTICATOR_GROUP
=
f
'http://{AUTHENTICATOR_IP}{AUTHENTICATOR_PATH}/authenticator-group
'
config/settings/production.py
View file @
d1b9d732
...
...
@@ -36,3 +36,4 @@ AUTHENTICATOR_IP = config['SERVICE']['AUTHENTICATOR_IP']
AUTHENTICATOR_PATH
=
'/api/v1/authenticator'
VALIDATE_TOKEN_URL
=
f
'http://{AUTHENTICATOR_IP}{AUTHENTICATOR_PATH}/validate-token/'
ACCOUNT_GROUP
=
f
'http://{AUTHENTICATOR_IP}{AUTHENTICATOR_PATH}/application-dependent'
\ No newline at end of file
config/settings/uat.py
View file @
d1b9d732
...
...
@@ -32,4 +32,5 @@ DATABASES = {
AUTHENTICATOR_IP
=
config
[
'SERVICE'
][
'AUTHENTICATOR_IP'
]
AUTHENTICATOR_PATH
=
'/api/v1/authenticator'
VALIDATE_TOKEN_URL
=
f
'http://{AUTHENTICATOR_IP}{AUTHENTICATOR_PATH}/validate-token/'
VALIDATE_TOKEN_URL
=
f
'http://{AUTHENTICATOR_IP}{AUTHENTICATOR_PATH}/authenticator-validate-token/'
AUTHENTICATOR_GROUP
=
f
'http://{AUTHENTICATOR_IP}{AUTHENTICATOR_PATH}/authenticator-group'
docker-compose.yml
View file @
d1b9d732
version
:
'
3'
services
:
main-service
:
rms_main
:
build
:
.
command
:
python manage.py runserver 0.0.0.0:8000
container_name
:
main-service
container_name
:
rms_main-container
volumes
:
-
.:/code
ports
:
-
9080:8000
\ No newline at end of file
-
7010:8000
networks
:
rms_main_network
:
ipv4_address
:
172.168.70.10
networks
:
rms_main_network
:
driver
:
bridge
ipam
:
config
:
-
subnet
:
172.17.0.0/16
requirements/local.txt
View file @
d1b9d732
B
certifi==2018.11.29
...
...
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