A library that connects to ams using argo-ams-library and syncs with mitreID and ssp
Project description
rciam-federation-registry-agent
Rciam federation registry agent main objective is to sync data between rciam federation registry with satosa and mitreId respectively.
This python library includes a module named ServiceRegistryAms/
to pull and publish messages from Argo messaging service using the argo-ams-library,
an API module named MitreidConnect/
to communicate with the api of the mitreId.
The main standalone scripts that are used to deploy updates to the third party services are under bin/
:
deployer_ssp
for simple saml phpdeployer_mitreid
for mitreid
Installation
First install the packages from the requirements.txt file
pip install -r requirements.txt
Install rciam-federation-registy-agent
pip install rciam-federation-registry-agent
Usage
deployer_ssp
deployer_ssp requires the path of the ssp config file as an argument
$ deployer_ssp -c example_deployers.config.json
deployer_mitreid
deployer_mitreid requires the path of the ssp config file as an argument
$ deployer_mitreid -c example_mitre.config.json
Configuration
Here is a description with the values that the mitreid and ssp conf file must include example_deployers.config.json
{
"ssp": {
"ams": {
"host": "example.host.com",
"project" : "ams-project-name-ssp",
"pull_topic" : "ams-topic-ssp",
"pull_sub" : "ams-sub-ssp",
"token" : "ams-token-ssp",
"pub_topic": "ams-publish-topic-ssp",
"poll_interval": 1,
"agent_id": "1"
},
"metadata_conf_file": "/path/to/ssp/metadata/file.php",
"cron_secret": "SSP cron secret",
"cron_url": "http://localhost/proxy/module.php/cron/cron.php",
"cron_tag": "hourly",
"request_timeout": 100
},
"mitreid": {
"ams": {
"host": "example.host.com",
"project" : "ams-project-name-mitreid",
"pull_topic" : "ams-topic-mitreid",
"pull_sub" : "ams-sub-mitreid",
"token" : "ams-token-mitreid",
"pub_topic": "ams-publish-topic-mitreid",
"poll_interval": 1,
"agent_id": "1"
},
"issuer": "https://example.com/oidc" ,
"refresh_token": "refresh token",
"client_id": "client ID",
"client_secret": "client secret"
},
"log_conf": "conf/logger.conf"
}
As shown above there are 2 main groups mitreid and ssp, for each group there are unique ams settings and service specific configuration values. The only global value is the log_conf
path if you want to use the same logging configuration for both of the deployers. In case you need a different configuration for a deployer you can add log_conf in the scope of "mitreid" or "ssp"
ServiceRegistryAms
Use ServiceRegistryAms as an manager to pull and publish messages from ams
from ServiceRegistryAms.PullPublish import PullPublish
with open('config.json') as json_data_file:
config = json.load(json_data_file)
ams = PullPublish(config)
message = ams.pull(1)
ams.publish(args)
MitreidConnect
Use MitreidConnect as an api manager to communicate with mitreId
- First obtain an access token and create the mitreId API client (find refreshTokenGrant under
Utils
directory)
access_token = refreshTokenGrant(issuer_url, refresh_token, client_id, client_secret)
mitreid_agent = mitreidClientApi(issuer_url, access_token)
- Use the following functions to create, delete and update a service on mitreId
response = mitreid_agent.createClient(mitreid_msg)
response = mitreid_agent.updateClientById(external_id, mitreid_msg)
response = mitreid_agent.deleteClientById(external_id)
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for rciam-federation-registry-agent-1.4.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 29a23e5b7b625f416ad14fd626cce68460af3ac62cddc2888869f8a66fa22a9b |
|
MD5 | bdf7018dd4806a6c12c6fbf3bcc88752 |
|
BLAKE2b-256 | c3baf20d9b2b0eedd92e010d8378053e425ceb54c06f57763601dc584ea77a62 |
Hashes for rciam_federation_registry_agent-1.4.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 46a169c9a6cf7a8e1965fb428f6673d8b6f7300041bee4f08a9a43d95ea70ef8 |
|
MD5 | 033b232a853237c39ecb045336a510e0 |
|
BLAKE2b-256 | 4cc201c5dffd589ed849bb58d4cb7c06e0d3b60d581adb51221954b7ca9eec93 |