This sample shows how to inject a low-level authorizer component that can control access to all API calls. It includes an implementation of the authorizer myAuthorizer which allows all requests to the "temporal-system" namespace and denies UpdateNameSpace calls for all other namespaces.
The sample implementation of the authorizer interface authorization.Authorizer allows all requests to the "temporal-system" namespace and denies UpdateNamespace calls for all other namespaces.
-
Start up the dependencies by running the
make start-dependenciescommand from within the main Temporal repository as described in the contribution guide. -
Create the database schema by running
make install-schema-cass-es. -
Start Temporal by running
go run authorizer/server/main.go. -
Use
temporalcli to interact with Temporal
- Run
temporal operator namespace listto list available namespaces. You should only see "temporal-system" initially. - Run
temporal operator namespace create -n testto create a namespace "test" - Run
temporal operator namespace listto see "test" listed - Run
temporal operator namespace update -n testto try to update the "test" namespace. You should see aPermissionDeniederror becausemyAuthorizerdeniesUpdateNamespacecalls.