suport credentials defined in settings

This commit is contained in:
Cayo Puigdefabregas 2023-11-29 12:06:53 +01:00
parent 7d477a079b
commit 222509c72c
2 changed files with 7 additions and 2 deletions

View File

@ -1,6 +1,7 @@
import json
import base64
from django.conf import settings
from django.views.generic.edit import View
from oidc4vp.models import Authorization, Organization
@ -19,8 +20,7 @@ from django.shortcuts import get_object_or_404
class VerifyView(View):
def get(self, request, *args, **kwargs):
org = self.validate(request)
# TODO Not hardcode the list of types of presentation_definition
presentation_definition = json.dumps(['MemberCredential'])
presentation_definition = json.dumps(settings.SUPPORTED_CREDENTIALS)
authorization = Authorization(
organization=org,
presentation_definition=presentation_definition

View File

@ -187,3 +187,8 @@ USE_L10N = True
AUTH_USER_MODEL = 'idhub_auth.User'
RESPONSE_URI = config('RESPONSE_URI', default="")
ALLOW_CODE_URI= config('ALLOW_CODE_URI', default="")
SUPPORTED_CREDENTIALS = config(
'SUPPORTED_CREDENTIALS',
default='[]',
cast=literal_eval
)