OpenFGA
Platform:
| Channel | Revision | Published | Runs on |
|---|---|---|---|
| latest/stable | 128 | 05 Jun 2025 | |
| latest/edge | 137 | 13 Jul 2026 | |
| latest/edge | 136 | 13 Jul 2026 | |
| 3.0/stable | 128 | 01 Aug 2025 | |
| 3.0/edge | 131 | 01 Aug 2025 | |
| 2.0/stable | 26 | 30 Jul 2025 | |
| 2.0/edge | 123 | 01 Apr 2025 | |
| 1.0/edge | 12 | 17 Oct 2023 |
juju deploy openfga-k8s
charms.openfga_k8s.v1.openfga
-
- Last updated 14 Sep 2026
- Revision Library version 1.6
Interface Library for OpenFGA.
DEPRECATED This charm library is deprecated in favor of the
charmlibs-interfaces-openfgaPyPI package. Please installcharmlibs-interfaces-openfgaand import fromcharmlibs.interfaces.openfga.
This library wraps relation endpoints using the openfga interface
and provides a Python API for requesting OpenFGA authorization model
stores to be created.
Getting Started
To get started using the library, you just need to fetch the library using charmcraft.
cd some-charm
charmcraft fetch-lib charms.openfga_k8s.v1.openfga
In the metadata.yaml of the charm, add the following:
requires:
openfga:
interface: openfga
Then, to initialise the library:
from charms.openfga_k8s.v1.openfga import (
OpenFGARequires,
OpenFGAStoreCreateEvent,
)
class SomeCharm(CharmBase):
def __init__(self, *args):
# ...
self.openfga = OpenFGARequires(self, "test-openfga-store")
self.framework.observe(
self.openfga.on.openfga_store_created,
self._on_openfga_store_created,
)
def _on_openfga_store_created(self, event: OpenFGAStoreCreateEvent):
if not event.store_id:
return
info = self.openfga.get_store_info()
if not info:
return
logger.info("store id {}".format(info.store_id))
logger.info("token {}".format(info.token))
logger.info("grpc_api_url {}".format(info.grpc_api_url))
logger.info("http_api_url {}".format(info.http_api_url))
Index
class OpenfgaRequirerAppData
Description
Openfga requirer application databag model. None
class OpenfgaProviderBaseData
Description
Openfga provider base application databag model. None
class OpenfgaProviderAppData
Description
Openfga requirer application databag model. None
class OpenFGAStoreCreateEvent
Description
Event emitted when a new OpenFGA store is created. None
Methods
OpenFGAStoreCreateEvent. __init__( self , handle: Handle , store_id: str )
OpenFGAStoreCreateEvent. snapshot( self )
Description
Save event. None
OpenFGAStoreCreateEvent. restore( self , snapshot: dict )
Description
Restore event. None
class OpenFGAStoreRemovedEvent
Description
Event emitted when a new OpenFGA store is removed. None
class OpenFGARequirerEvents
Description
Custom charm events. None
class OpenFGARequires
This class defines the functionality for the 'requires' side of the 'openfga' relation.
Description
Hook events observed: - relation-created - relation-changed - relation-departed
Methods
OpenFGARequires. __init__( self , charm: CharmBase , store_name: str , relation_name: str )
OpenFGARequires. get_store_info( self )
Description
Get the OpenFGA store and server info. None
class OpenFGAStoreRequestEvent
Description
Event emitted when a new OpenFGA store is requested. None
Methods
OpenFGAStoreRequestEvent. __init__( self , handle: Handle , relation: Relation , store_name: str )
OpenFGAStoreRequestEvent. snapshot( self )
Description
Save event. None
OpenFGAStoreRequestEvent. restore( self , snapshot: dict )
Description
Restore event. None
class OpenFGAProviderEvents
Description
Custom charm events. None
class OpenFGAProvider
Description
Requirer side of the openfga relation. None
Methods
OpenFGAProvider. __init__( self , charm: CharmBase , relation_name: str , http_port , grpc_port , scheme )
OpenFGAProvider. update_relation_app_data( self , data: OpenfgaProviderAppData , relation_id: int )
OpenFGAProvider. update_relations_app_data( self , data: OpenfgaProviderBaseData )