janus-idp / backstage-plugins

Plugins for Backstage
https://janus-idp.io
Apache License 2.0
151 stars 150 forks source link

🔌 Plugin: OCI Registry (Nexus) #567

Closed schultzp2020 closed 1 year ago

schultzp2020 commented 1 year ago

🔖 Summary

We want to have a plugin similar to Quay and JFrog Actifactory for OCI Registry (Nexus). ie: https://showcase.janus-idp.io/catalog/default/component/backstage-showcase/quay

🌐 Project website (if applicable)

https://www.sonatype.com/products/sonatype-nexus-repository

✌️ Context

This new plugin could start from the JFrog Artifactory plugin source code as it will display similar information.

To get the data, we need to authenticate and use the Nexus APIs. Here is the link to the Nexus REST API docs.

👀 Have you spent some time to check if this plugin request has been raised before?

🏢 Have you read the Code of Conduct?

Are you willing to submit PR?

Yes I am willing to submit a PR!

schultzp2020 commented 1 year ago

Repository Health Check is not support for docker registries.

RHC is only available for proxy repositories in Go, Maven, npm, NuGet, PyPI, RubyGems, and Yum formats.

schultzp2020 commented 1 year ago

We cannot follow the <QuayPage /> component because Security Scan, Size and Expires do not exist in the API response.

{
    "id": "dGVzdDowOTk1YmJhZWViMWZiYzNlYzQ1YzI3NGNlNGQ5ZjI0YQ",
    "repository": "test",
    "format": "docker",
    "group": null,
    "name": "janus-idp/backstage-showcase",
    "version": "latest",
    "assets": [
        {
            "downloadUrl": "http://localhost:8081/repository/test/v2/janus-idp/backstage-showcase/manifests/latest",
            "path": "v2/janus-idp/backstage-showcase/manifests/latest",
            "id": "dGVzdDplMWE2YjhjMzhkMzFmYWNhOTM4M2RkMGI5NGI5MmU3Yw",
            "repository": "test",
            "format": "docker",
            "checksum": {
                "sha1": "4874cf3dbf4c12365447f45e9a746dc6c9e5d89b",
                "sha256": "4da28319e3d3b7c2428df0c2ead194235673c80dffc5cb190295d9f8556704f4"
            },
            "contentType": "application/vnd.docker.distribution.manifest.v2+json",
            "lastModified": "2023-07-26T20:33:20.586+00:00",
            "lastDownloaded": null,
            "uploader": "admin",
            "uploaderIp": "172.17.0.1",
            "fileSize": 1586,
            "blobCreated": "2023-07-26T20:33:20.586+00:00"
        }
    ]
}

cc @christophe-f

christophe-f commented 1 year ago

We can skip the Security scan for now like in ACR and JFrog Artifactory.

The size should be available via the fileSize attribute. We could show the created date blobCreated instead of the Expires as it's not in the payload.

schultzp2020 commented 1 year ago

Sadly fileSize is not the image size, I think its related to the dockerfile size since its only 1.5KB

christophe-f commented 1 year ago

Yes, it's the manifest file size.