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

feat: course credentials as verifiable credentials #2674

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kyrylo-kh
Copy link
Contributor

@kyrylo-kh kyrylo-kh commented Jan 2, 2025

Description:
Add the ability to generate verifiable credentials for course credentials

Related PR's:

@kyrylo-kh kyrylo-kh requested a review from a team as a code owner January 2, 2025 10:22
@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Jan 2, 2025
@openedx-webhooks
Copy link

openedx-webhooks commented Jan 2, 2025

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.

🔘 Get product approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.

🔘 Provide context

To help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads

🔘 Get a green build

If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.


Where can I find more information?

If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:

When can I expect my changes to be merged?

Our goal is to get community contributions seen and reviewed as efficiently as possible.

However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

@kyrylo-kh kyrylo-kh changed the title feat: course credentials as verifiable credentials Draft: feat: course credentials as verifiable credentials Jan 2, 2025
@kyrylo-kh kyrylo-kh changed the title Draft: feat: course credentials as verifiable credentials feat: course credentials as verifiable credentials Jan 2, 2025
@kyrylo-kh kyrylo-kh marked this pull request as draft January 2, 2025 10:24
@kyrylo-kh kyrylo-kh force-pushed the feat/course-credentials-as-verifiable-credentials branch from 1c56e13 to 0f2911b Compare January 2, 2025 10:26
@kyrylo-kh kyrylo-kh force-pushed the feat/course-credentials-as-verifiable-credentials branch 7 times, most recently from aa84901 to 5e24144 Compare January 2, 2025 14:21
@kyrylo-kh kyrylo-kh force-pushed the feat/course-credentials-as-verifiable-credentials branch 3 times, most recently from 7350c69 to 89e9f8a Compare January 17, 2025 14:58
@kyrylo-kh kyrylo-kh marked this pull request as ready for review January 17, 2025 15:04
Copy link
Member

@deborahgu deborahgu left a 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
Copy link
Member

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.

Copy link
Contributor Author

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

Copy link
Contributor Author

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:
Copy link
Member

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")
Copy link
Member

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.)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@GlugovGrGlib GlugovGrGlib self-requested a review January 23, 2025 11:31
@kyrylo-kh kyrylo-kh force-pushed the feat/course-credentials-as-verifiable-credentials branch from 89e9f8a to 272acea Compare January 27, 2025 09:08
Copy link
Member

@deborahgu deborahgu left a 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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
open-source-contribution PR author is not from Axim or 2U
Projects
Status: No status
Status: Waiting on Author
Development

Successfully merging this pull request may close these issues.

3 participants