-
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: [FC-0006] add Verifiable Credentials optional feature #1973
Merged
justinhynes
merged 1 commit into
openedx:master
from
raccoongang:dcc/oex-creds-696/verifiable-credentials
May 23, 2023
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
""" | ||
Admin section configuration. | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from django.apps import AppConfig | ||
|
||
|
||
class VerifiableCredentialsConfig(AppConfig): | ||
name = "credentials.apps.verifiable_credentials" | ||
verbose_name = "Verifiable Credentials" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
""" | ||
Verifiable Credentials self-checks. | ||
""" |
3 changes: 3 additions & 0 deletions
3
credentials/apps/verifiable_credentials/composition/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
""" | ||
Verifiable Credentials different data models specifications. | ||
""" |
4 changes: 4 additions & 0 deletions
4
credentials/apps/verifiable_credentials/composition/open_badges.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
""" | ||
Open Badges 3.0.* data model. | ||
See specification: https://1edtech.github.io/openbadges-specification/ob_v3p0.html | ||
""" |
3 changes: 3 additions & 0 deletions
3
credentials/apps/verifiable_credentials/composition/schemas.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
""" | ||
Complementary schemas for verifiable credential composition. | ||
""" |
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
""" | ||
Composition utils. | ||
""" |
5 changes: 5 additions & 0 deletions
5
credentials/apps/verifiable_credentials/composition/verifiable_credentials.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
""" | ||
Verifiable Credentials v1.1 data model. | ||
|
||
See specification: https://www.w3.org/TR/vc-data-model/ | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
""" | ||
Issuance module. | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
""" | ||
Issuance line processor. | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
""" | ||
Verifiable Credentials DB models. | ||
""" |
3 changes: 3 additions & 0 deletions
3
credentials/apps/verifiable_credentials/issuance/renderers.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
""" | ||
Verifiable credentials renderers. | ||
""" |
3 changes: 3 additions & 0 deletions
3
credentials/apps/verifiable_credentials/issuance/serializers.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
""" | ||
Verifiable Credentials serializers. | ||
""" |
6 changes: 6 additions & 0 deletions
6
credentials/apps/verifiable_credentials/issuance/status_list.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
""" | ||
Status List issuance utils. | ||
|
||
Status list is managed for each Issuer separately. | ||
Status lists are verifiable credentials themselves, but with a specific shape. | ||
""" |
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
""" | ||
Issuance utils. | ||
""" |
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
""" | ||
Verifiable credentials specific permissions. | ||
""" |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
"""Root API URLs for verifiable_credentials.""" | ||
from django.conf.urls import include | ||
from django.urls import re_path | ||
|
||
|
||
urlpatterns = [ | ||
re_path(r"^v1/", include(("credentials.apps.verifiable_credentials.rest_api.v1.urls", "v1"), namespace="v1")), | ||
] |
Empty file.
Empty file.
Empty file.
11 changes: 11 additions & 0 deletions
11
credentials/apps/verifiable_credentials/rest_api/v1/urls.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
""" | ||
Verifiable Credentials API v1 URLs. | ||
""" | ||
from rest_framework import routers | ||
|
||
|
||
router = routers.DefaultRouter() | ||
|
||
urlpatterns = [] | ||
|
||
urlpatterns += router.urls |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
""" | ||
Settings for Verifiable Credentials are all namespaced in the VERIFIABLE_CREDENTIALS setting. | ||
This is pretty similar to what the DRF does, like this: | ||
|
||
VERIFIABLE_CREDENTIALS = { | ||
'setting_1': 'value_1', | ||
'setting_2': 'value_2', | ||
} | ||
|
||
This module provides the `vc_setting` object, that is used to access | ||
Verifiable Credentials settings, checking for explicit settings first, then falling | ||
back to the defaults. | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
""" | ||
Verifiable Credentials signal handlers. | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
""" | ||
Verifiable Credentials built-in storage backends. | ||
""" |
Empty file.
3 changes: 3 additions & 0 deletions
3
credentials/apps/verifiable_credentials/storages/status_list.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
""" | ||
Status List 2021 storage. | ||
""" |
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
""" | ||
Storages utils. | ||
""" |
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
""" | ||
Toggles for verifiable_credentials app. | ||
""" | ||
|
||
from edx_toggles.toggles import SettingToggle | ||
|
||
|
||
# .. toggle_name: ENABLE_VERIFIABLE_CREDENTIALS | ||
# .. toggle_implementation: DjangoSetting | ||
# .. toggle_default: False | ||
# .. toggle_description: Determines if the Credentials IDA uses digital credentials issuance. | ||
# .. toggle_warning: Requires the Learner Record MFE to be deployed and used in a given environment if toggled to true. | ||
# .. toggle_life_expectancy: permanent | ||
# .. toggle_permanent_justification: Digital Credentials are optional for usage. | ||
# .. toggle_creation_date: 2023-02-02 | ||
# .. toggle_use_cases: open_edx | ||
ENABLE_VERIFIABLE_CREDENTIALS = SettingToggle("ENABLE_VERIFIABLE_CREDENTIALS", default=False, module_name=__name__) | ||
|
||
|
||
def is_verifiable_credentials_enabled(): | ||
return ENABLE_VERIFIABLE_CREDENTIALS.is_enabled() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
""" | ||
URLs for verifiable_credentials. | ||
""" | ||
from django.conf.urls import include | ||
from django.urls import re_path | ||
|
||
|
||
urlpatterns = [ | ||
re_path(r"^api/", include(("credentials.apps.verifiable_credentials.rest_api.urls", "api"), namespace="api")), | ||
] |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
As I understand it, the
__init__.py
of a Django app should have adefault_app_config
defined and point to the Config class defined in theapps.py
(in this case theVerifiableCredentialsConfig
class).Not sure if this was missed or just being planned for later, but figured I'd add it here in case it was missed.
(I also have a half-baked assumption that since the
ready
function isn't defined as part of theVerifiableCredentialsConfig
class, we might not be able to add a declaration for thedefault_app_config
yet)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.
(I also see that there is a larger part 2 OSPR I wasn't immediately aware of, we could probably address that there)