Skip to content

Commit 0c7c6d8

Browse files
committed
feat: remove examples from pipeline
1 parent 18fd667 commit 0c7c6d8

File tree

7 files changed

+35
-117
lines changed

7 files changed

+35
-117
lines changed

.coveragerc

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ omit =
1919
indykite_sdk/utils/message_to_value.py
2020
indykite_sdk/utils/logger.py
2121
tests/*
22+
examples/*
2223

2324
[report]
2425
exclude_lines =

.gitignore

+20
Original file line numberDiff line numberDiff line change
@@ -137,3 +137,23 @@ dmypy.json
137137

138138
# Snyk
139139
.dccache
140+
141+
# Sphinx documentation
142+
docs/_build/
143+
144+
examples/sdk-frontend/.package-lock.json
145+
examples/sdk-frontend/.yarn.lock
146+
examples/sdk-frontend/.pnpm-lock.yaml
147+
examples/sdk-frontend/.pnpm-lock.yml
148+
149+
examples/sdk-frontend/node_modules
150+
151+
examples/sdk-frontend/build
152+
examples/sdk-frontend/public/build
153+
examples/sdk-frontend/.env
154+
155+
examples/sdk-frontend/cypress/screenshots
156+
examples/sdk-frontend/cypress/videos
157+
examples/sdk-frontend/postgres-data
158+
159+
examples/sdk-frontend/app/styles/tailwind.css

MANIFEST.in

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
include CHANGELOG.md
22
include version.py
3-
prune tests/
3+
prune tests/
4+
prune examples/

codecov.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,4 @@ ignore:
2525
- "indykite_sdk/utils/message_to_value.py"
2626
- "indykite_sdk/utils/logger.py"
2727
- "tests"
28+
- "examples"

examples/sdk-backend/.gitignore

-105
This file was deleted.

indykite_sdk/api.py

+5-6
Original file line numberDiff line numberDiff line change
@@ -2079,11 +2079,10 @@ def main():
20792079
return what_authorized
20802080

20812081
elif command == "who_authorized":
2082-
actions = ["ACTION1", "ACTION2"]
2083-
resources = [WhoAuthorizedResource("resourceID", "TypeName", actions),
2084-
WhoAuthorizedResource("resource2ID", "TypeName", actions)]
2085-
input_params = {"age": "21"}
2086-
policy_tags = ["Car", "Rental", "Sharing"]
2082+
actions = ["HAS_FREE_PARKING"]
2083+
resources = [WhoAuthorizedResource("parking-lot-id1", "ParkingLot", actions)]
2084+
input_params = {}
2085+
policy_tags = []
20872086
who_authorized = client_authorization.who_authorized(
20882087
resources,
20892088
input_params,
@@ -2267,7 +2266,7 @@ def main():
22672266
headers = {"Authorization": "Bearer "+access_token,
22682267
'Content-Type': 'application/json'}
22692268
response_post = requests.post(endpoint, json=data, headers=headers)
2270-
# print(response_http2.token_source.token.access_token)
2269+
print(response_http2.token_source.token.access_token)
22712270
if response_post.text is not None:
22722271
print_response(response_post.text)
22732272

tests/helpers/api_requests.py

+6-5
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
import random
44
import requests
55
from helpers import data
6+
from indykite_sdk.oauth2 import HttpClient
67

78

89
def first_reg_request():
@@ -73,7 +74,7 @@ def second_login(thread_id, email, password):
7374

7475

7576
def send_post(body):
76-
x = requests.post(data.get_url()+"/auth/"+data.get_application(), json=body)
77+
x = requests.post(data.get_url()+"/auth/v2/"+data.get_application(), json=body)
7778
return x.json()
7879

7980

@@ -90,10 +91,10 @@ def send_token_verification(token):
9091

9192

9293
def registration(email, password):
93-
resp = first_reg_request()
94-
resp = second_reg_request(resp["~thread"]["thid"], email, password)
95-
resp = verify_request(resp["~thread"]["thid"])
96-
return resp["token"], resp["refresh_token"]
94+
client_http = HttpClient()
95+
response_http = client_http.get_http_client()
96+
access_token = response_http.get_token()
97+
return access_token, access_token
9798

9899

99100
def registration_with_email_verification(email, password):

0 commit comments

Comments
 (0)