G2P Registry Datashare: WebSub
Module name
g2p_registry_datashare_websub
Module title
G2P Registry Datashare: WebSub
Technology base
Functionality
This module adds functionality that enables sharing of Registry data to external partners via WebSub.
Refer to Data Sharing with WebSub feature documentation.
Automatically publishes the configuration to WebSub when a config record is created.
There is also an Odoo action to manually sync the current selected config data to WebSub.
Automatically publishes event data to WebSub whenever the particular event is raised.
There is also a button which can be used to manually publish selected records
Configuration
Name
name
Can be a combination of Partner name and event type. (Each Datashare config should considered unique for the combination of partner_id + event_type.)
Partner ID
partner_id
This should exactly match the Keycloak client ID of the partner.
Event Type
event_type
This decides which event type this partner is interested in. If the partner is interested in more than one event duplicate this entire config for the other event_type(s).
Data Transform JQ Expression
transform_data_jq
This JQ filter will be used to convert original data into final data that is supposed to be sent to partner. The following fields are available in the original JSON data.
web_base_url
: Root URL to access Social Registry.publisher
: This configuration record data itself - available as JSON.curr_datetime
: Current Datetimedata
: Only the part of the data that is changed. For advanced usage only. (TODO: elaborate)record_data
: Entire Record data - as JSON.extra_fields
: Any extra fields configured - available as JSON with the key being the extra field's name.
Condition JQ Expression
condition_jq
For advanced usage only. (TODO: elaborate)
true
Extra Fields
extra_fields
Table of set of additional fields to be computed before sending data to partner. Can contain signed JWT, etc.
Topic Joiner
topic_joiner
For advanced usage only. Final WebSub topic name will be constructed as {partner_id}{topic_joiner}{event_type}
.
/
Encryption Provider ID
encryption_provider_id
Encryption Provider to be used for signing the JWT, etc. Leave blank to take the default encryption provider. This will decide whether to use keymanager (if so which keys in keymaanger) or any custom encryption provider.
WebSub Base URL
websub_base_url
WebSub Hub Url. This should be K8s internal service url.
http://websub/hub
WebSub Auth URL (Token Endpoint)
websub_auth_url
Keycloak OAuth2 Token endpoint
WebSub Auth Client ID
websub_auth_client_id
Keycloak Client ID of Publisher (Social Registry). (Not the partner)
openg2p-sr-<ns>
WebSub Auth Client Secret
websub_auth_client_secret
Keycloak Client Secret of Publisher (Social Registry). (Not the partner)
WebSub Auth Grant Type
websub_auth_grant_type
client_credentials
WebSub API Timeout
websub_api_timeout
Timeout to be used while publishing data to WebSub. Given in seconds.
10
Active
active
If this is off, this config will not be considered for automatic publishing of data when the event occurs. Manual Publish can still be used.
true
Source code
https://github.com/OpenG2P/openg2p-registry/tree/17.0-develop/g2p_registry_datashare_websub
Last updated
Was this helpful?