Skip to content

Commit 7275026

Browse files
committed
default csp headers updated
1 parent e6bdf02 commit 7275026

File tree

6 files changed

+14
-9
lines changed

6 files changed

+14
-9
lines changed

README.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,6 @@ git clone https://github.com/mindsphere/mindsphere-python-sdk-examples.git
6161
- Unzip the downloaded file.
6262
- Navigate to <some path where unzipped folder is located>/mindsphere-python-sdk_1.0.3/modules/
6363
- Copy .whl files of required dependent service/services in 'requirements' folder. (For this project(mindsphere-sdk-python-examples) we will need all the .whl files but you can choose to use only required subset of all available SDKs for your project.)
64-
- Kindly note that Tenant Credential Support is removed from python SDKs from now. Hence we strongly recommend using
65-
latest version(1.0.3) of mindsphere-core library.
6664
- `requirements` folder is already created for your convenience.
6765
- For convenience, requirements.txt is populated with relative path to copied dependencies.
6866

@@ -125,8 +123,8 @@ git clone https://github.com/mindsphere/mindsphere-python-sdk-examples.git
125123
- In case of Self Hosted Application, component name and URL will be as per customer's deployment strategy.
126124
8. Add one endpoint for your component using /** to match all of your application paths.
127125
9. Set the content-security-policy according to the examples:
128-
- For Europe1 : default-src 'self' *.eu1.mindsphere.io; style-src * 'unsafe-inline'; script-src 'self' 'unsafe-inline' *.eu1.mindsphere.io; img-src * data:;
129-
- For Europe2: default-src 'self' *.eu1.mindsphere.io *.eu2.mindsphere.io; style-src * 'unsafe-inline'; script-src 'self' 'unsafe-inline' *.eu1.mindsphere.io *.eu2.mindsphere.io; img-src * data:;
126+
- For Europe1 : default-src 'self' *.eu1.mindsphere.io; style-src * 'unsafe-inline'; script-src 'self' 'unsafe-inline' *.eu1.mindsphere.io code.jquery.com cdnjs.cloudflare.com; font-src 'self' 'unsafe-inline' fonts.gstatic.com *.eu1.mindsphere.io; img-src * data:;
127+
- For Europe2: default-src 'self' *.eu1.mindsphere.io *.eu2.mindsphere.io; style-src * 'unsafe-inline'; script-src 'self' 'unsafe-inline' *.eu1.mindsphere.io *.eu2.mindsphere.io code.jquery.com cdnjs.cloudflare.com; font-src 'self' 'unsafe-inline' fonts.gstatic.com *.eu1.mindsphere. *.eu2.mindsphere.io; img-src * data:;
130128
10. Click on **Save**.
131129

132130
#### Add roles and Scopes

manifest.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,5 @@ applications:
1818
MDSP_OS_VM_APP_VERSION: <YOUR-APPLICATION-VERSION--HERE> #application version provided in Developer Cockpit at a time of application creation.
1919
MDSP_KEY_STORE_CLIENT_ID: <YOUR-CLIENT-ID-HERE> #CLIENT_ID of application received from `App Credentials` in Developer Cockpit
2020
MDSP_KEY_STORE_CLIENT_SECRET: <YOUR-HOST-TENANT-HERE> #CLIENT_SECRET of application received from `App Credentials` in Developer Cockpit
21-
#For mindsphere-java-sdk-examples above environment variables are sufficient.
22-
#You can append your own environment variables here.
21+
2322

requirements.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ requirements/iotfileservices-3.2.4-py3-none-any.whl
33
requirements/assetmanagement-3.11.2-py3-none-any.whl
44
requirements/eventanalytics-3.1.3-py3-none-any.whl
55
requirements/iottsbulk-3.5.0-py3-none-any.whl
6-
requirements/timeseries-3.4.2-py3-none-any.whl
6+
requirements/timeseries-3.4.1-py3-none-any.whl
77
requirements/iottsaggregates-4.0.0-py3-none-any.whl
8-
requirements/mindconnect-3.5.1-py3-none-any.whl
8+
requirements/mindconnect-3.5.0-py3-none-any.whl
99
PyJWT==1.7.1
1010
python-dateutil==2.8.0
1111
pytz==2018.9

tokentype/templates/test_urls.html

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
rel="stylesheet">
88
<link rel="stylesheet" type="text/css"
99
href="https://cdnjs.cloudflare.com/ajax/libs/swagger-ui/3.24.2/swagger-ui.css">
10-
<link rel="stylesheet" type="text/css" href="/swagger-ui/SwaggerHeader.css">
1110
<style>
1211
html {
1312
box-sizing: border-box;

tokentype/urls.py

+1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@
88
path('logs/', views.LogsView.as_view()),
99
path('cls/', views.LogsClearView.as_view()),
1010
path('', views.IndexView.as_view()),
11+
path('app-info.json', views.AppInfoView.as_view()),
1112
]

tokentype/views.py

+8
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,14 @@ def get(self, request):
3434

3535
return HttpResponse(os.environ['MDSP_USER_TENANT'], content_type='application/string', status=status.HTTP_200_OK)
3636

37+
class AppInfoView(APIView):
38+
39+
def get(self, request):
40+
"""
41+
Show Application Info.
42+
"""
43+
44+
return HttpResponse("Python SDK Sample Example", content_type='application/string', status=status.HTTP_200_OK)
3745

3846
class TokenView(APIView):
3947

0 commit comments

Comments
 (0)