-
Notifications
You must be signed in to change notification settings - Fork 75
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
Allow customization of QR code page #713
Comments
@Gavinok one note worth mentioning (thanks @loneil for reminding me): the QR page is served via a get endpoint as it needs to be processed by the server using a Jinja template to inject the values relevant for the transaction (namely the URL that the QR code will link to). We need to ensure this step is retained so that all variables exposed by the vc-authn service can be referenced and correctly resolved when rendering a template, even if it is a custom one. |
Here are some general plans for this ticket We want to make the directory and template file into env vars and use a helm volume replacing the templates directory for user defined static element. Location that needs to be made into a env var https://github.com/bcgov/vc-authn-oidc/blob/main/oidc-controller/api/main.py#L51 How we currently import user_variable_substitution.py here https://github.com/bcgov/vc-authn-oidc/blob/main/charts/vc-authn-oidc/templates/configmap.yaml#L9 Make the directory configurable here https://github.com/bcgov/vc-authn-oidc/blob/main/charts/vc-authn-oidc/values.yaml Add a new volume here https://github.com/bcgov/vc-authn-oidc/blob/main/charts/vc-authn-oidc/templates/deployment.yaml#L39 The mount this new volume here https://github.com/bcgov/vc-authn-oidc/blob/main/charts/vc-authn-oidc/templates/deployment.yaml#L132 volumes:
- name: jwt-token
secret:
secretName: {{ include "vc-authn-oidc.token.secretName" . }}
defaultMode: 256
- name: controller-config
configMap:
name: {{ include "global.fullname" . }}-controller-config
- name: template
emptyDir: {} containers:
- name: {{ include "global.fullname" . }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
volumeMounts:
- name: template
mountPath: /path/to/template As far as the handling of passing values into templates a formal api will be outlined on the exposed variables Users will be responsible for making use of these exposed variables in their templates. |
@esune Since these exposed values are compiled at runtime these templates can be replaced at any time as long as the assets needed are configured https://github.com/bcgov/vc-authn-oidc/blob/main/charts/vc-authn-oidc/values.yaml so that all the templates can access the associated js/css/etc |
I have decided that the best mode of action would be to now extract the QR code functionality into separate files to allow for the core styling to be modified by users. |
In order to support custom UX for the QR code page, it needs to be possible to replace the default page and assets.
There are two options to do this:
Custom resources for the QR page should always include an HTML page, with CSS and JS resources either defined inline or referenced. This should allow support for more complex SPAs that can be built separately and then injected into the deployment.
The text was updated successfully, but these errors were encountered: