Skip to content
Snippets Groups Projects
Commit d5d67c8c authored by Arie Peterson's avatar Arie Peterson
Browse files

Merge branch '178-upgrade-kratos-api-client-library' into 'main'

Resolve "Upgrade kratos api client library"

Closes #178

See merge request !154
parents 2c737fec 00371e82
No related branches found
No related tags found
1 merge request!154Resolve "Upgrade kratos api client library"
Pipeline #43106 passed with stages
in 4 minutes and 52 seconds
......@@ -22,10 +22,13 @@ kratos_identity_api = identity_api.IdentityApi(kratos_client)
class UserService:
@staticmethod
def get_users():
page = 1
page = 0
userList = []
while page > 0:
res = KratosApi.get("/admin/identities?per_page=1000&page={}".format(page)).json()
while page >= 0:
if page == 0:
res = KratosApi.get("/admin/identities?per_page=1000").json()
else:
res = KratosApi.get("/admin/identities?per_page=1000&page={}".format(page)).json()
for r in res:
# removed the app role assignment function, passing simple user data
# userList.append(UserService.__insertAppRoleToUser(r["id"], r))
......
......@@ -133,9 +133,12 @@ class KratosUser():
kratos_id = None
# Get out user ID by iterating over all available IDs
page = 1
while page > 0:
data = api.list_identities(per_page=1000, page=page)
page = 0
while page >= 0:
if page == 0:
data = api.list_identities(per_page=1000)
else:
data = api.list_identities(per_page=1000, page=page)
for kratos_obj in data:
# Unique identifier we use
if kratos_obj.traits['email'] == email:
......@@ -158,9 +161,12 @@ class KratosUser():
kratos_id = None
return_list = []
# Get out user ID by iterating over all available ID
page = 1
while page > 0:
data = api.list_identities(per_page=1000, page=page)
page = 0
while page >= 0:
if page == 0:
data = api.list_identities(per_page=1000)
else:
data = api.list_identities(per_page=1000, page=page)
for kratos_obj in data:
kratos_id = str(kratos_obj.id)
return_list.append(KratosUser(api, kratos_id))
......
......@@ -23,7 +23,7 @@ MarkupSafe==2.1.1
mypy-extensions==0.4.3
NamedAtomicLock==1.1.3
oauthlib==3.2.0
ory-kratos-client==0.11.0
ory-kratos-client==1.0.0
ory-hydra-client==1.11.8
pathspec==0.9.0
platformdirs==2.5.1
......
......@@ -23,4 +23,4 @@ name: stackspin-dashboard
sources:
- https://open.greenhost.net/stackspin/dashboard/
- https://open.greenhost.net/stackspin/dashboard-backend/
version: 1.8.2
version: 1.8.3-kratos1
......@@ -68,7 +68,7 @@ dashboard:
image:
registry: open.greenhost.net:4567
repository: stackspin/dashboard/dashboard
tag: 0.8.2
tag: 178-upgrade-kratos-api-client-library
digest: ""
## Optionally specify an array of imagePullSecrets.
## Secrets must be manually created in the namespace.
......@@ -236,7 +236,7 @@ backend:
image:
registry: open.greenhost.net:4567
repository: stackspin/dashboard/dashboard-backend
tag: 0.8.2
tag: 178-upgrade-kratos-api-client-library
digest: ""
## Optionally specify an array of imagePullSecrets.
## Secrets must be manually created in the namespace.
......@@ -723,7 +723,7 @@ tests:
image:
registry: open.greenhost.net:4567
repository: stackspin/dashboard/cypress-test
tag: 0.8.2
tag: 178-upgrade-kratos-api-client-library
pullPolicy: IfNotPresent
credentials:
user: ""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment