-
Notifications
You must be signed in to change notification settings - Fork 71
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
feat: add Accredible integration #2675
base: master
Are you sure you want to change the base?
Conversation
Thanks for the pull request, @kyrylo-kh! This repository is currently maintained by Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review.
|
11374b7
to
0a7f487
Compare
207ae36
to
2c042b4
Compare
2c042b4
to
9855ff4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Non-blocking concern: It seems sensible to have verifiable credentials as a django app in the IDA, but I would expect it to be generic, with the Accredible integration as a plugin (which could be provided in an openedx
plugin repo). Otherwise it seems like we're recreating the same technical debt issues that we've been removing for the last couple of years, putting a specific 3rd party SaaS provider's code, and a specific implementation, directly into the IDA.
Especially since we have a good plug-in framework now, I would think this would be an opportunity for a formal openedx
plugin (which would also be modeling a great practice for the community).
The more I think about it, the more I feel like this is a blocking concern. Certainly on the Unless there's a reason we can't, it seems to me that moving forward, all new integrations to a specific third-party vendor should be in a plugin. In this case, again, in a public, official, (FWIW I felt the same way about Credly but didn't say anything then; since that time it's become more clear that Axim views vendor-specific third party API integrations as plugin material, so consistency would suggest following this model.) |
@deborahgu Does the Credentials IDA support plugins using the event driving model, or at all today? |
I'm not positive. Certainly I know we can run our standard edx_django_utils plug-in utilities. And I can see that The OEP for hooks specifically references Accredible as its very first use case, and all of the existing filter documentation on design practices and how-tos use "third-party certificate verification service" as their use case. (obviously those examples all take place on |
@deborahgu Answer for your concern
This implementation was agreed with the @e0d |
@GlugovGrGlib will you be able to find time to review? I believe you did some thinking about adding plugins to the Credentials IDA, but I'm not sure if there was any progress on that front. |
@deborahgu I agree with your overall argument here. However, I'd like to propose that we capture the work as technical debt rather than block this change on the refactoring. I'll do my best to prioritize getting in done in the next ~2 quarters or so. @cmltaWt0 I believe you have done a back of the envelope estimate? Could that be the basis of a ticket to capture the required work here? |
@e0d I'm amenable to looking at this work with the plan to switch to a plugin based-system. I will go ahead and review this code now on its own merits, and I will look forward to seeing the new scope of work. (cc @justinhynes @kbuchanan-2u) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks good to me! I'm approving, although I did put in some nonblocking feedback.
site_id (int): ID of the site. | ||
|
||
Returns: | ||
int | None: processed items. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[two issues, both nonblocking]
would you be able to rewrite this docstring for clarity? I was scratching my head for a while trying to figure out why on earth you were returning a length, because I thought that the return value here was supposed to actually be something about the processed items. It took me a while to realize that it meant something more like
int | None: processed items. | |
int: Number of groups synchronized |
Also, in general, I feel like the fall through behavior should just be returning 0
if raw_groups
is empty. On the one hand, it's not that difference in terms of consumption. if None
and if 0
will have the same effect. But on the other hand, it's good to have a method that always returns a single type (and in fact, you've type hinted this as -> int
, not as -> Optional[int]
).
if accredible_config.get("USE_SANDBOX"): | ||
return accredible_config["ACCREDIBLE_SANDBOX_API_BASE_URL"] | ||
|
||
return accredible_config["ACCREDIBLE_API_BASE_URL"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this one seems like it actually should get a real test.
api_config_id = options.get("api_config_id") | ||
|
||
if site_id is None: | ||
self.stdout.write(f"Side ID wasn't provided: assuming site_id = {DEFAULT_SITE_ID}") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
self.stdout.write(f"Side ID wasn't provided: assuming site_id = {DEFAULT_SITE_ID}") | |
self.stdout.write(f"Site ID wasn't provided: assuming site_id = {DEFAULT_SITE_ID}") |
if origin == CredlyBadgeTemplate.ORIGIN: | ||
CredlyBadgeTemplateIssuer().award(username=username, credential_id=badge_template_id) | ||
elif origin == AccredibleGroup.ORIGIN: | ||
AccredibleBadgeTemplateIssuer().award(username=username, credential_id=badge_template_id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems like it's worth a test
if origin == CredlyBadgeTemplate.ORIGIN: | ||
CredlyBadgeTemplateIssuer().revoke(badge_template_id, username) | ||
elif origin == AccredibleGroup.ORIGIN: | ||
AccredibleBadgeTemplateIssuer().revoke(badge_template_id, username) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same.
Description:
Add integration with Accredible service for badges