Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Post-sync and Sign Sync Connector #552

Merged
merged 107 commits into from Apr 14, 2020

Conversation

adorton-adobe
Copy link
Collaborator

@adorton-adobe adorton-adobe commented Nov 19, 2019

  • Implement the infrastructure for the post-sync connector
  • Marshal post-sync data - a model representing the current state of users and group assignments in the Admin Console
  • Implement the Sign sync connector - manage group assignments and admin privileges in Adobe Sign

Notes:

  • Documentation is incomplete. The manual page is done, but I still need to finish the tutorial page
  • The new images in the user_manual directory are part of the tutorial. I'll move them over (and probably delete those we don't need)

Fixes #551

Copy link
Contributor

@vossen-adobe vossen-adobe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Excited about this overall! The main items to me were error handling and documentation, as detailed in the comments.


if self.version == "v6":
return requests.get(url + "baseUris", headers=self.header()).json()['apiAccessPoint'] + endpoint
return requests.get(url + "base_uris", headers=self.header()).json()['api_access_point'] + endpoint
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We discussed on the call, but error handling in general will greatly improve the usability of the connector. In this instance, the call to access a dictionary key 'api_access_point' fails with a cryptic KeyError if the api key is incorrect.

self.console_org = config['console_org'] if 'console_org' in config else None
self.api_url = self.base_uri()
self.groups = self.get_groups()
self.default_group_id, = [_id for name, _id in self.groups.items() if name == self.DEFAULT_GROUP_NAME]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused field self.default_group_id


### Config Spec

| key | type | required? | notes |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A clearer explanation of what the groups keys mean and how they are related would be helpful. In addition, some discussion of what it means to use multiple sign orgs or umapis and how the sync works in that case.

self.admin_email = config['admin_email']
self.console_org = config['console_org'] if 'console_org' in config else None
self.api_url = self.base_uri()
self.groups = self.get_groups()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The question of whether to call the sign API to query groups prior to running the sync tool. Does it make more sense to call this method in the run() call so as to avoid

(1) not breaking the normal sync if the call fails for some reason
(2) a potentially very long delay between when groups are fetched from sign and when they are actually used

I think its good to keep the base_uri() call since it provides immediate feedback if the api key is wrong.

OR - in contrast to the above, does it make sense to add some kind of post sync validation code to check the configuration of a post sync so we know the authentication will be good when the time comes. Again, I'm just thinking in terms of large scale / long sync processes. Might be overkill.

"""
for connector in self.connectors:
self.logger.info("Running module " + connector.name)
connector.run(post_sync_data)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good opportunity for error handling to avoid hard stop if one of the post sync connectors errors out

@adorton-adobe
Copy link
Collaborator Author

@vossen-adobe I've made the changes you've requested and have resolved the merge conflicts. Please take another look when you get a chance.

@adorton-adobe adorton-adobe added this to the v2.6.0 milestone Apr 2, 2020
examples/config files - basic/user-sync-config.yml Outdated Show resolved Hide resolved
user_sync/config.py Show resolved Hide resolved
@adorton-adobe
Copy link
Collaborator Author

@vossen-adobe Ready for another look

@adorton-adobe adorton-adobe merged commit 85c9d22 into adobe-apiplatform:v2 Apr 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sign Sync Connector
4 participants