Giter Club home page Giter Club logo

move-service-registry's Introduction

Service Registry

The service registry component (SR) is a component designed to run centralized, and has the follwing main features

  • It Creates a single network address participants need to access. This simplifies firewall configuration
  • It enable organisations to manage messaging for others. The SR component can return the organization number and certificate for a third party for services

Example request

http://localhost:8080/organization/986186999

Example response

  • The response always has an Information record. The information record says what channel the organization wants messages sent over (POST VIRKSOMHET, EDU etc)
  • The response has 1..N ServiceRecords. Each Service record represents one channel the organisation can receive messages over. For each ServiceRecord there is a certificate, EndPoint and organzation number.
  • The sender can not use the receivers organization number blindly. The sender must always use the organisation number in the relevant ServiceRecord.
{
  "serviceRecords": [
    {
      "serviceRecord": {
        "serviceIdentifier": "EDU",
        "organisationNumber": "986186999",
        "x509Certificate": "-----BEGIN CERTIFICATE-----\nMIID/DCCAuSgAwIBAgIEYs5oXjANBgkqhkiG9w0BAQsFADBeMRIwEAYDVQQKEwlE\naWZpIHRlc3QxEjAQBgNVBAUTCTk5MTgyNTgyNzE0MDIGA1UEAxMrRElGSSB0ZXN0\nIHZpcmtzb21oZXRzc2VydGlmaWF0IGludGVybWVkaWF0ZTAeFw0xNTExMTYwODIy\nNDlaFw0xNzEyMTYwODIyNDlaMD0xEjAQBgNVBAUTCTk4NjE4Njk5OTEnMCUGA1UE\nAxMeRElGSSB0ZXN0IHZpcmtzb21oZXRzc2VydGlmaWF0MIIBIjANBgkqhkiG9w0B\nAQEFAAOCAQ8AMIIBCgKCAQEAvsKx0wO6pkRrClupprDxEx3imfXupLukcJCYE6Pz\n6915ZSDvURb+c+k+7p14hT193NiWcIOxvsldu43+hCQy5m4NEasRWMJTrTvuGt+q\nlykwCOW3955wIYIaI9pzGmH1qyGBqJJYSU+t/T8GbQSUweyZBxYdwxOotZKS3IU0\nnczP7gmu2/By8hFPdRf+b/ELsMhWHBwY70bpljYrtZG4lPdmpfC6TFljN/2dKGqX\n1QaszeDOLnNaiZNFRBbSaV8mrMktoeH4Jx6SixfppDz6Lioh8cxdaMBxOGlGd+vf\nK1MvFNdFfgSfPFqG9Y093KC4PrIeZuTqwmRDYsXY68HaTwIDAQABo4HiMIHfMIGL\nBgNVHSMEgYMwgYCAFCeuypqN1OjDIoi4bYBAcNfT83GzoWKkYDBeMRIwEAYDVQQK\nEwlEaWZpIHRlc3QxEjAQBgNVBAUTCTk5MTgyNTgyNzE0MDIGA1UEAxMrRElGSSB0\nZXN0IHZpcmtzb21oZXRzc2VydGlmaWF0IGludGVybWVkaWF0ZYIEJoRZSzAdBgNV\nHQ4EFgQU5yU6DYMxrB8EKC/lGoaHAkhaTcYwCQYDVR0TBAIwADAVBgNVHSAEDjAM\nMAoGCGCEQgEBAQFkMA4GA1UdDwEB/wQEAwIEsDANBgkqhkiG9w0BAQsFAAOCAQEA\nQq2NAMB1Q68uGpZpOp5br2mMmz3FhwAo/uTbJG0IYHRQhMGmufyQrU2SeEIgcLBd\ne8jyA3G5hcuXWNPHslpBP9TfbEPwViTS49PJwmlZ5J7xYI7JX1OjzjLBX2upnQK4\nY1gAMMWYJMh3eiRdRuRenBxFXH57JTNr5/viH81mcJnICjEaVzFyAzbG6PqU4mIX\nz1RxESkGQJkbXlMN2mKL9xSrwNl2LxRYjogOD27kW1/+jfazDWN9aaA7Txkbcsy+\nAHXSybQT/gWiYEdS4ZRrS9KukloEeDP9uytqnsa67O8u9caKwVeKxlLsmK9YvUIV\nINmlpJtvJQ+SCeuvfsxDsw==\n-----END CERTIFICATE-----\n",
        "endPointURL": "https://www.altinn.no"
      },
      "_links": {
        "setprimary": {
          "href": "http://localhost:8080/organization/primary?orgnr=986186999&serviceidentifier=EDU"
        }
      }
    },
    {
      "serviceRecord": {
        "serviceIdentifier": "POST_VIRKSOMHET",
        "organisationNumber": "986186999",
        "x509Certificate": "-----BEGIN CERTIFICATE-----\nMIID/DCCAuSgAwIBAgIEYs5oXjANBgkqhkiG9w0BAQsFADBeMRIwEAYDVQQKEwlE\naWZpIHRlc3QxEjAQBgNVBAUTCTk5MTgyNTgyNzE0MDIGA1UEAxMrRElG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JMh3eiRdRuRenBxFXH57JTNr5/viH81mcJnICjEaVzFyAzbG6PqU4mIX\nz1RxESkGQJkbXlMN2mKL9xSrwNl2LxRYjogOD27kW1/+jfazDWN9aaA7Txkbcsy+\nAHXSybQT/gWiYEdS4ZRrS9KukloEeDP9uytqnsa67O8u9caKwVeKxlLsmK9YvUIV\nINmlpJtvJQ+SCeuvfsxDsw==\n-----END CERTIFICATE-----\n",
        "endPointURL": null
      },
      "_links": {
        "setprimary": {
          "href": "http://localhost:8080/organization/primary?orgnr=986186999&serviceidentifier=POST_VIRKSOMHET"
        }
      }
    }
  ],
  "infoRecord": {
    "primaryServiceIdentifier": "POST_VIRKSOMHET",
    "organisationNumber": "986186999"
  }
}

How to change the primary service for an organisation

Every service record has a link that can be used to set it as the primary. Look for this part of the JSON response and copy the URL directly into a Browser of REST client

  "_links": {
        "setprimary": {
          "href": "http://localhost:8080/organization/primary?orgnr=986186999&serviceidentifier=POST_VIRKSOMHET"
        }
      }

Current implementation limitations

  • The organisations that are managed by KS is hard coded in lack of a cental lookup service, the managed organsations are 910951688 and 910076787. A new Implementation of the KSLookup interface can be created when- and if a central service becomes available.
  • The persistent store for keeping how organisations want to receive messages (primary service) is kept in-memory at (as a map) the moment. This functionality might not be relevant for a production scenario - so very little effort went into it.

Depenencies

Please note, as of 7.4.2016: To build this module you need to have the following non public modules in your local maven repository

          <dependency>
              <groupId>no.difi.virksert</groupId>
              <artifactId>virksert-common</artifactId>
              <version>1.0-SNAPSHOT</version>
          </dependency>
          <dependency>
              <groupId>no.difi.virksert</groupId>
              <artifactId>virksert-client</artifactId>
              <version>1.0-SNAPSHOT</version>
          </dependency>

move-service-registry's People

Contributors

ekorra avatar glennbech avatar martinwam avatar mhoel avatar

Watchers

 avatar  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.