Skip to content

Commit

Permalink
feat: remove examples from pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
cowan-macady committed May 15, 2023
1 parent 18fd667 commit 0c7c6d8
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 117 deletions.
1 change: 1 addition & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ omit =
indykite_sdk/utils/message_to_value.py
indykite_sdk/utils/logger.py
tests/*
examples/*

[report]
exclude_lines =
Expand Down
20 changes: 20 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,23 @@ dmypy.json

# Snyk
.dccache

# Sphinx documentation
docs/_build/

examples/sdk-frontend/.package-lock.json
examples/sdk-frontend/.yarn.lock
examples/sdk-frontend/.pnpm-lock.yaml
examples/sdk-frontend/.pnpm-lock.yml

examples/sdk-frontend/node_modules

examples/sdk-frontend/build
examples/sdk-frontend/public/build
examples/sdk-frontend/.env

examples/sdk-frontend/cypress/screenshots
examples/sdk-frontend/cypress/videos
examples/sdk-frontend/postgres-data

examples/sdk-frontend/app/styles/tailwind.css
3 changes: 2 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include CHANGELOG.md
include version.py
prune tests/
prune tests/
prune examples/
1 change: 1 addition & 0 deletions codecov.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ ignore:
- "indykite_sdk/utils/message_to_value.py"
- "indykite_sdk/utils/logger.py"
- "tests"
- "examples"
105 changes: 0 additions & 105 deletions examples/sdk-backend/.gitignore

This file was deleted.

11 changes: 5 additions & 6 deletions indykite_sdk/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -2079,11 +2079,10 @@ def main():
return what_authorized

elif command == "who_authorized":
actions = ["ACTION1", "ACTION2"]
resources = [WhoAuthorizedResource("resourceID", "TypeName", actions),
WhoAuthorizedResource("resource2ID", "TypeName", actions)]
input_params = {"age": "21"}
policy_tags = ["Car", "Rental", "Sharing"]
actions = ["HAS_FREE_PARKING"]
resources = [WhoAuthorizedResource("parking-lot-id1", "ParkingLot", actions)]
input_params = {}
policy_tags = []
who_authorized = client_authorization.who_authorized(
resources,
input_params,
Expand Down Expand Up @@ -2267,7 +2266,7 @@ def main():
headers = {"Authorization": "Bearer "+access_token,
'Content-Type': 'application/json'}
response_post = requests.post(endpoint, json=data, headers=headers)
# print(response_http2.token_source.token.access_token)
print(response_http2.token_source.token.access_token)
if response_post.text is not None:
print_response(response_post.text)

Expand Down
11 changes: 6 additions & 5 deletions tests/helpers/api_requests.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import random
import requests
from helpers import data
from indykite_sdk.oauth2 import HttpClient


def first_reg_request():
Expand Down Expand Up @@ -73,7 +74,7 @@ def second_login(thread_id, email, password):


def send_post(body):
x = requests.post(data.get_url()+"/auth/"+data.get_application(), json=body)
x = requests.post(data.get_url()+"/auth/v2/"+data.get_application(), json=body)
return x.json()


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


def registration(email, password):
resp = first_reg_request()
resp = second_reg_request(resp["~thread"]["thid"], email, password)
resp = verify_request(resp["~thread"]["thid"])
return resp["token"], resp["refresh_token"]
client_http = HttpClient()
response_http = client_http.get_http_client()
access_token = response_http.get_token()
return access_token, access_token


def registration_with_email_verification(email, password):
Expand Down

0 comments on commit 0c7c6d8

Please sign in to comment.