Commit 79c30504 authored by GromeTT's avatar GromeTT
Browse files

Enh: added some debug logging

parent 226bb449
......@@ -2,7 +2,7 @@
it in a dedicated thread."""
import pykka
from s3i import TokenType
from fml40.app_logger import APP_LOGGER
class ManagedActor(pykka.ThreadingActor):
"""Provides an encapsulation class for digital twins allowing to run
......@@ -15,7 +15,9 @@ def __init__(self, idp, refManagingActor, name, proxy_name):
self.managing_actor = refManagingActor.proxy()
self.managing_actor.register_managed_actor(name, self.actor_ref.proxy())
self.proxy_name = proxy_name
APP_LOGGER.debug("Requesting access token")
self.access_token = idp.get_token(TokenType.ACCESS_TOKEN)
APP_LOGGER.debug("Received access token")
def on_receive(self, message):
"""Prints a greatings formula and message to stdout.
......
......@@ -5,7 +5,7 @@
"""
import pykka
from s3i import TokenType
from fml40.app_logger import APP_LOGGER
class ManagingActor(pykka.ThreadingActor):
"""This is the administration shell of the forwarder.
......@@ -21,7 +21,9 @@ def __init__(self, idp, config):
self.thing_id = config["thingId"]
self.name = config["type"]
self.proxy_functionalities = dict()
APP_LOGGER.debug("Requesting access token")
self.access_token = idp.get_token(TokenType.ACCESS_TOKEN)
APP_LOGGER.debug("Received access token")
# APP_LOGGER.debug("Initialized managing actor")
def on_receive(self, message):
......
......@@ -38,12 +38,17 @@ def get_idp(config):
:rtype:s3i.IdentiyProvider
"""
client_id = config["thingId"]
secret = config["client_secret"]
APP_LOGGER.debug(f"Creating identity provider:\n"
f"thing_id:\t{client_id}\n"
f"secret:\t\t{secret}")
id_p = IdentityProvider(
grant_type="client_credentials",
identity_provider_url="https://idp.s3i.vswf.dev/",
realm="KWH",
client_id=config["thingId"],
client_secret=config["client_secret"],
client_id=client_id,
client_secret=secret
)
return id_p
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment