-
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: course credentials as verifiable credentials #2674
base: master
Are you sure you want to change the base?
feat: course credentials as verifiable credentials #2674
Conversation
Thanks for the pull request, @kyrylo-kh! This repository is currently maintained by @2U-aperture. 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.
|
1c56e13
to
0f2911b
Compare
aa84901
to
5e24144
Compare
7350c69
to
89e9f8a
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.
This looks good to me. I had some questions but the answers to all of them might be "yeah, that's totally fine."
There is one docstring that needs to be updated but other than that this looks real solid.
elif model == "coursecertificate": | ||
course_run = CourseRun.objects.filter(key=credential.credential.course_id).first() | ||
course = getattr(course_run, "course", None) | ||
credential_uuid = credential.credential.course_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.
is this right? I'm not sure of the details of how verifiable credentials is intended to work for course certificates, but is the credential UUID actually supposed to be the course ID, here?
...oh, reading the returned data block, I guess the uuid
is the credential UUID, and credential_uuid
is the course or program UUID? I think I get it, that's confusing.
Personally I would add the shape of this returned data to the doc string I asked you to modify in ProgramCredentialsViewSet.list
, because it's not intuitive. If it's according to the open schema -- I didn't see it there, but then again I didn't look very hard! -- you could just reference it there as something like returns: a list of objects encoded according to the Foobar 1.0 schema for Xyzzy objects.
Nonblocking but it would be nice.
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.
The difference between course certificates and program certificates is that programs have a unique UUID, while courses do not, they only have course-id
. I agree that it can be confusing. credential_uuid
field is not shown on UI, it's just unique value for card. I'll extend docstring
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.
"program_org": ", ".join( | ||
|
||
data = [] | ||
for credential in credentials: |
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.
thanks for restructuring this to make it more readable!
Arguments: | ||
request: A request to control data returned in endpoint response | ||
Returns: | ||
response(dict): Information about the user's program credentials | ||
""" | ||
program_credentials = get_user_program_credentials_data(request.user.username) | ||
return Response({"program_credentials": program_credentials}) | ||
types = self.request.query_params.get("types") |
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.
should you update the docstring to show this new argument, so that the generated openAPI documentation will be useful?
(to be honest I'm not sure what the current doc string really means -- request: A request to control data returned in endpoint response
isn't clear to me, and it's not really an argument, it's just the request.)
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.
89e9f8a
to
272acea
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.
looks good to me. thanks for the answers and changes!
Description:
Add the ability to generate verifiable credentials for course credentials
Related PR's: