GithubHelp home page GithubHelp logo

steelhead31 / marketplace-api.adoptium.net Goto Github PK

View Code? Open in Web Editor NEW

This project forked from adoptium/marketplace-api.adoptium.net

0.0 0.0 0.0 7.48 MB

Adoptium Marketplace API ๐Ÿš€

Home Page: https://marketplace-api.adoptium.net

License: Apache License 2.0

Shell 0.88% Java 25.80% Kotlin 71.78% CSS 0.45% HTML 0.26% Dockerfile 0.83%

marketplace-api.adoptium.net's Introduction

Adoptium marketplace

This repo contains:

  • adoptium-marketplace-schema
    • Schema definition for vendors to advertise their binaries
  • adoptium-marketplace-client
    • Client library for reading a repository with vendor data
  • adoptium-marketplace-server
    • Implementation of the adoptium marketplace API
  • exampleRepositories
    • Examples of a vendor repository

Build

Build with

./mvnw clean install

Testing

Tests rely on the data inside the exampleRepositories directory in order for tests to pass they must be signed. If you wish to modify test assets they need to be re-signed once they have been modified. The procedure would be as follows:

  • Generate test keys
    • Look in the exampleRepositories/keys directory for scripts that detail generating keys
  • Re-sign assets
    • Run SignTestAssets in the adoptium-marketplace-utils project.

Repository validation

A repository can be validated using the MarketplaceClient. The client pulls a repository and validates its contents. For example:

    String publicKey = "-----BEGIN PUBLIC KEY-----\n" +
    // Public key string here
    "-----END PUBLIC KEY-----";
    String repoUrl = "http://localhost:8080/repo";

    try {
        MarketplaceClient client = MarketplaceClient.build(repoUrl, SignatureType.BASE64_ENCODED, publicKey);
        ReleaseList releaseList = client.readRepositoryData();
    
        System.out.println("Found: " + releaseList.getReleases().size() + " releases");
    } catch (Exception e) {
        System.err.println("Validation failed");
        e.printStackTrace();
    }

Note that in this example we have used the default SignatureType.BASE64_ENCODED which specifies that the signature files are base64 encoded. If you require non-base64 encoded use SignatureType.SIG.

An example of running this can be seen in RepoTest class in the adoptium-marketplace-client module. To validate your repo using this test, edit it to add your public key and repo location, then run with:

VALIDATE_REPO=true ../mvnw test -Dtest=RepoTest#validateRepo

from inside the adoptium-marketplace-client directory.

marketplace-api.adoptium.net's People

Contributors

dependabot[bot] avatar karianna avatar johnoliver avatar gdams avatar nickebbitt avatar tellison avatar zdtsw avatar adam-thorpe avatar debjitms avatar heubeck avatar m-davies avatar jerboaa avatar alesharik avatar parkerm avatar sxa avatar sakshi1215 avatar bmarwell avatar joschi avatar jlgager24 avatar mstoodle avatar xavierfacq avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.