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

fix(download-microservices): handle the ms urls in the correct way #988

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

matteo-cristino
Copy link
Collaborator

No description provided.

@matteo-cristino matteo-cristino linked an issue Mar 6, 2025 that may be closed by this pull request
@matteo-cristino matteo-cristino changed the title refactor(download-microservices): create a specific Dockerfile for each microservices fix(download-microservices): handle the ms urls in the correct way Mar 6, 2025
Copy link
Contributor

github-actions bot commented Mar 6, 2025

Release cc7f5da to https://988.pr.didroom.com

@@ -32,10 +32,10 @@ SPDX-License-Identifier: AGPL-3.0-or-later
$: issuanceFlowQr = generateQr(
createIntentUrl({
credential_configuration_ids: [service.type_name],
credential_issuer: credential_issuer.endpoint,
credential_issuer: credential_issuer.endpoint.endsWith('/credential_issuer') ? credential_issuer.endpoint : `${credential_issuer.endpoint}/credential_issuer`,
Copy link
Member

Choose a reason for hiding this comment

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

I see the intent to overcome automagically error prone endpoints, that is lovely. But you suppose that the credential_issuer is not correct if left at the end of a string. I would prefer to not suppose but maybe have a real check, like check that gives you a 404 or a 200... you can go with a small helper that does a simple HTTP method and checks the status. Then you choose the one that is correct for the better. Actually also accurate checks can be done, but guess that for now is super fine. Something like

   credential_issuer: `${sanitizeCredentialIssuerEndpoint(credential_issuer.endpoint)}`

grants: {
authorization_code: {
authorization_server: authorization_server.endpoint
authorization_server: authorization_server.endpoint.endsWith('/authz_server') ? authorization_server.endpoint : `${authorization_server.endpoint}/authz_server`,
Copy link
Member

Choose a reason for hiding this comment

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

same as above

@@ -19,7 +19,8 @@ export const config = {
credential_issuer: 'openid-credential-issuer',
relying_party: 'openid-relying-party'
},
env_example: '.env.example'
env_example: '.env.example',
dockerfile: 'Dockerfile'
Copy link
Member

Choose a reason for hiding this comment

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

SUPER PRO AND USELESS TIP: leave the final comma also to the end of the list item of an array/object (so next time in diff there is no the previous line changed ;) unless it's JSON, valid for js/ts objects.


//

export function add_microservice_dockerfile(zip: AdmZip, microservice: Microservice, microservice_folder: MicroserviceFolder) {
Copy link
Member

Choose a reason for hiding this comment

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

I really feel bad on having half methods snake_case and half in camelCase... please agree and choose one convention and stick to it ;(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Microservices qrcode and url
2 participants