diff --git a/Makefile b/Makefile index 8772207..34c9331 100644 --- a/Makefile +++ b/Makefile @@ -7,4 +7,6 @@ build-image: docker build --target build \ --tag openfga:latest \ ./images - +push-microk8s: build-image + docker tag openfga:latest localhost:32000/openfga:latest + docker push localhost:32000/openfga:latest \ No newline at end of file diff --git a/charms/openfga-k8s/lib/charms/openfga_k8s/v0/openfga.py b/charms/openfga-k8s/lib/charms/openfga_k8s/v0/openfga.py index d4e5b3a..eadd3ca 100644 --- a/charms/openfga-k8s/lib/charms/openfga_k8s/v0/openfga.py +++ b/charms/openfga-k8s/lib/charms/openfga_k8s/v0/openfga.py @@ -54,8 +54,13 @@ def _on_openfga_store_created(self, event: OpenFGAStoreCreateEvent): secret = self.model.get_secret(id=event.token_secret_id) content = secret.get_content() # and get the token with content["token"] + if event.token: + # get the token from event.token ``` +As you can see the OpenFGA charm will attempt to use Juju secrets to pass the token +to the requiring charm. However if the Juju version does not support secrets it will +fall back to passing plaintext token via relation fata. """ import logging diff --git a/charms/openfga-k8s/tests/charms/openfga_requires/lib/charms/openfga_k8s/v0/openfga.py b/charms/openfga-k8s/tests/charms/openfga_requires/lib/charms/openfga_k8s/v0/openfga.py index a0217e4..da3e916 100644 --- a/charms/openfga-k8s/tests/charms/openfga_requires/lib/charms/openfga_k8s/v0/openfga.py +++ b/charms/openfga-k8s/tests/charms/openfga_requires/lib/charms/openfga_k8s/v0/openfga.py @@ -54,8 +54,13 @@ def _on_openfga_store_created(self, event: OpenFGAStoreCreateEvent): secret = self.model.get_secret(id=event.token_secret_id) content = secret.get_content() # and get the token with content["token"] + if event.token: + # get the token from event.token ``` +As you can see the OpenFGA charm will attempt to use Juju secrets to pass the token +to the requiring charm. However if the Juju version does not support secrets it will +fall back to passing plaintext token via relation fata. """ import logging