Add two new endpoints to the Tenant app for the Broker to query information
GET /api/v1/broker
POST /api/v1/broker
The GET API allows the Broker to query information about tenants in a JSON object (see below example format). The top level object is an array and each entry pertains to a different tenant.
The GET API should cache this payload for a configurable (env var) amount of time - default to 5 mins.
The POST API allows the Broker to notify the Tenant service about stuff happening (i.e, an SP subscribing to a tenant's policy)
The Broker will continuously try to re-POST the same payload until it gets a 200 SUCCESS code - this way we ensure the message gets through in the event of a failure
The POST endpoint also will contain a signature/payload correlating to the subscription event, which will be stored in TenantSPsMeta in the database (Also TBD: a history table that stores a log of these messages over time`
Both GET and POST endpoints need to be secured with a bearer token "pre-shared key", which, for simplicity can be provided to the app using an environment variable at runtime (ex, ENV_BROKER_ACCESS_TOKEN )
Description:
/api/v1/broker
/api/v1/broker
GET
API allows the Broker to query information about tenants in a JSON object (see below example format). The top level object is an array and each entry pertains to a different tenant.GET
API should cache this payload for a configurable (env var) amount of time - default to 5 mins.POST
API allows the Broker to notify the Tenant service about stuff happening (i.e, an SP subscribing to a tenant's policy)200 SUCCESS
code - this way we ensure the message gets through in the event of a failurePOST
endpoint also will contain a signature/payload correlating to the subscription event, which will be stored inTenantSPsMeta
in the database (Also TBD: ahistory
table that stores a log of these messages over time`GET
andPOST
endpoints need to be secured with a bearer token "pre-shared key", which, for simplicity can be provided to the app using an environment variable at runtime (ex,ENV_BROKER_ACCESS_TOKEN
)Depends on https://github.com/data-preservation-programs/spade/issues/60 for the
provider_tenant_state_info
Sample payload
ETA: YYY-MM-DD Maintainer:
Known dependencies:
View this starmap at: