mint-o-badges / badgr-server

Open Badge issuing and management with Django
GNU Affero General Public License v3.0
3 stars 1 forks source link

server: make baked badge assertions more portable #152

Open zven opened 5 months ago

zven commented 5 months ago

At the moment, when baging / exporting a badge, it stores mainly IDs / references to our server for its details (following the linked data model):

{
  "@context": "https://w3id.org/openbadges/v2",
  "type": "Assertion",
  "id": "https://api.staging.openbadges.education/public/assertions/6KTo8PxlQRGx4j8ITKHJtQ",
  "badge": "https://api.staging.openbadges.education/public/badges/ze6qwN58Sgu06RBIMcfiDQ",
  "image": "https://api.staging.openbadges.education/public/assertions/6KTo8PxlQRGx4j8ITKHJtQ/image",
  "verification": {
    "type": "HostedBadge"
  },
  "issuedOn": "2024-05-27T11:49:44.513497+00:00",
  "recipient": {
    "hashed": true,
    "type": "email",
    "identity": "sha256$472adb9a176b9ed17bd6e165f7bcde75b02912d229a9bc1f968f0dd95088f11a",
    "salt": "83940f39fbdb45c682706be1746085ad"
  }
}

To create a more portable representation, it's also possible to additionally store the (now only linked) information in the badge as well as highlighted in the Open Badge Standard 2.0 under Linked Data with some examples.

Idea: Store the linked data as well in the badge to ensure higher portability and make sure the badge still contains information once our servers are not up and running anymore.

zven commented 2 months ago

Update:

Similar to this example from the OB 2.0 standard, we should save additional information the badge an its issuer. This is merely an addition to the URI we already store in a baked badge. In addition, we also need to export the competencies. Example:

"extensions:CategoryExtension": {
                "type": [
                    "Extension",
                    "extensions:CategoryExtension"
                ],
                "extensions:Category": "competency"
            },
            "extensions:CompetencyExtension": [
                {
                    "type": [
                        "Extension",
                        "extensions:CompetencyExtension"
                    ],
                    "extensions:category": "skill",
                    "extensions:description": "Analysieren von Texten, die illustriert werden sollen, Recherchieren und Überprüfen der Quellen.",
                    "extensions:escoID": "/esco/skill/bf425f64-93d1-41c0-ab2d-1d02d026204d",
                    "extensions:name": "für die Illustration vorgesehene Texte analysieren",
                    "extensions:studyLoad": 1
                },
                {
                    "type": [
                        "Extension",
                        "extensions:CompetencyExtension"
                    ],
                    "extensions:category": "skill",
                    "extensions:description": "Verfassen schriftlicher Texte in altgriechischer Sprache.",
                    "extensions:escoID": "/esco/skill/877057bc-7be8-4d40-9bab-cda10eb4b999",
                    "extensions:name": "Altgriechisch schreiben",
                    "extensions:studyLoad": 121
                },
                {
                    "type": [
                        "Extension",
                        "extensions:CompetencyExtension"
                    ],
                    "extensions:category": "skill",
                    "extensions:description": "Studieren von Original-Musikstücken, um sich mit Musiktheorie und -geschichte vertraut zu machen.",
                    "extensions:escoID": "/esco/skill/2fa41ec9-5a43-4976-b34d-8639596f67ba",
                    "extensions:name": "Musik studieren",
                    "extensions:studyLoad": 3600
                }
            ],

This would include

zven commented 3 weeks ago

@timber-they Could this potentially break the current internal and external verification processes that can be reached via the public assertion link (e.g. https://staging.openbadges.education/public/assertions/1f3NdjycRomus8y1_XVyxg)?

Image

timber-they commented 3 weeks ago

@zven it could break if we don't implement it properly. A bit of context: We use https://badgecheck.io/ for verifying our badges. This runs the Open Badges Validator. This verifies the badges based on the Open Badges 2.0 standard; so everything that is valid within this standard supposedly also gets reported as valid. This includes linked data (which is also validated and included in the report from the validator).

I think it's worth it to try out how hard it is to add the information in a valid way and periodically check if the created badges are still validated by badgecheck during the development process. But then I don't see why we shouldn't be able to link that data.

zven commented 3 weeks ago

@timber-they Thanks for the input! Apart from the formal aspect, my main concern is atm that those validators compare the information that is stored as text in the baked badge with the information about the badge that is stored on our server. In case someone edit the information of a badge on the server (as is still possible at the moment), the information in the baked image would not match the one on the server.

This would be something we should explicitly test when implementing this ticket.

timber-they commented 2 weeks ago

@zven that is a valid concern. I would however also not be sure how it should behave in my opinion. Like, it is also reasonable to say that it shouldn't be valid anymore if the information stored in it is not up to date anymore, right? But either way, we should know exactly how it behaves to document it properly. But as you said, I think it makes sense to test it when implementing it.

zven commented 1 week ago

@timber-they Once you are done with https://github.com/mint-o-badges/badgr-server/issues/176, I see this ticket as a next task for you.