Giter Club home page Giter Club logo

hmrc.customs-dit-licences's Introduction

customs-dit-licences

This service receives licence usage data from the backend system and passes it on to DIT-LITE. It accepts an XML payload but does not verify it. If the XML is malformed then a Bad Request error is raised. The response received from the DIT-LITE service, error or otherwise, is returned unmodified to the backend system. The request/response sequence from the backend to this service to DIT-LITE is synchronous.

Two endpoints are available. Both require an authorisation token.

Licence Usage

Endpoint -

/send-entry-usage

Late Licence Usage

Endpoint -

/send-late-usage

Switching service endpoints

Dynamic switching of service endpoints has been implemented for the DIT-LITE connector. To configure dynamic switching of the endpoint there must be a corresponding section in the application config file (see example below). This should contain the endpoint config details.

Example

The service dit-lite-entry-usage has a default configuration and a stub configuration. Note that default configuration is declared directly inside the dit-lite-entry-usage section.

Prod {
    ...
    services {
        ...
        dit-lite-entry-usage {
            host = some.host
            port = 80
            bearer-token = "real"
            context = /context
            
            stub {
              host = localhost
              port = 80
              bearer-token = "some_stub_token"
              context = /context
            }
        }
    }
}

Switch service configuration to stub for an endpoint

REQUEST

curl -X "POST" http://customs-dit-licences-host/test-only/service/dit-lite-entry-usage/configuration -H 'content-type: application/json' -d '{ "environment": "stub" }'

RESPONSE

The service dit-lite-entry-usage is now configured to use the stub environment

Switch service configuration to default for an endpoint

REQUEST

curl -X "POST" http://customs-dit-licences-host/test-only/service/dit-lite-entry-usage/configuration -H 'content-type: application/json' -d '{ "environment": "default" }'

RESPONSE

The service dit-lite-entry-usage is now configured to use the default environment

Get the current configuration for a service

REQUEST

curl -X "GET" http://customs-dit-licences-host/test-only/service/dit-lite-entry-usage/configuration

RESPONSE

{
  "service": "dit-lite-entry-usage",
  "environment": "stub",
  "url": "http://currenturl/send-entry-usage"
  "bearerToken": "current token"
}

License

This code is open source software licensed under the Apache 2.0 License.

hmrc.customs-dit-licences's People

Contributors

paulblakehmrc avatar rashadmughal avatar googley42 avatar hmrc-web-operations avatar mattclark-zerogravit avatar cichockimc avatar phil-hargreaves avatar raysonviswas avatar tomasz-rosiek 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.