Giter Site home page Giter Site logo

third-party-application's Introduction

Third Party Application

The Third Party Application microservice is responsible for maintaining the state of applications created by (or on behalf of) third parties to consume APIs registered on the API Platform.

Application Search

Searching of Applications within the microservice is acheived by issuing a GET to the /applications endpoint, making use of the following Query Parameters:

Parameter Name Data Type/Allowed Values Description
search Free Text Search Application names and identifiers
status CREATED, PENDING_GATEKEEPER_CHECK, PENDING_SUBMITTER_VERIFICATION, ACTIVE Retrieve Applications based on lifecycle status
accessType STANDARD, ROPC, PRIVILEGED Access type that Application uses
apiSubscription ANY, NONE, or specific API name Which API the Application is subscribed to
apiVersion Version Number Version of the specific API that Application is subscribed to. Only relevant when the name of an API has been specified for apiSubscription
lastUseBefore ISO Representation of date and (optionally) time (e.g. 2020-01-01 and 2020-01-01T15:35:22Z are both valid) Applications that were last accessed before the specified date and time
lastUseAfter ISO Representation of date and (optionally) time (e.g. 2020-01-01 and 2020-01-01T15:35:22Z are both valid) Applications that were last accessed after the specified date and time

Additionally, the results can be sorted through use of the following query parameters:

Parameter Name Data Type/Allowed Values Description
sort NAME_ASC, NAME_DESC, SUBMITTED_ASC, SUBMITTED_DESC, LAST_USE_ASC, LAST_USE_DESC Sort by application name, creation data, or last use date, ascending or descending respectively. Defaults to SUBMITTED_ASC if not specified

Finally, the following query parameters are used to control the number of results returned:

Parameter Name Data Type/Allowed Values Description
page Number (Defaults to 1 if not specified) The page number to display (based on pageSize)
pageSize Number (Defaults to Int.MaxValue if not specified) The maximum number of results to return

Examples

Request Description
/applications All Applications
/applications?status=CREATED All Applications in testing
/applications?search=foo All Applications containing the text foo in either their name or id
/applications?apiSubscription=test-service&apiVersion=v1 All Applications subscribing to v1 of test-service API
/applications?accessType=STANDARD&page=1&pageSize=25 First 25 Applications using Standard access type

Hashing of Secrets

The microservice holds details of credentials that are used to generate OAuth2 tokens in the form of Client Secrets. The secrets are hashed in the database using bcrypt. Bcrypt is an adaptive hashing function, meaning its resilience to brute force attacks can be adjusted by configuring the number of iterations the hashing function goes through - the greater the number, the longer it takes exponentially to generate the hash. This is configured in the microservice using the hashFunctionWorkFactor configuration item.

Note, however, that there is a trade off to be made when configuring the work factor for the hashing function. Increasing the value will have a direct impact on the performance of token generation and, by extension, the API Platform as a whole. Any modifications to the value should be thoroughly performance tested prior to being put into External Test and Production.

To assist, a scheduled job has been created - BCryptPerfomanceMeasureJob - that runs on a regular basis to show how long hashing using the various work factors will take, given the current underlying hardware the service is running on. Should hardware performance increase (e.g. if MDTP starts using higher performance AWS instances), this should be reflected here, and could be a signal that the work factor can be increased.

If the configured work factor is changed, existing hashes within the database will still work automatically. However, the service will also re-hash any valid secrets received using the updated work factor value.

Tests

Some tests require MongoDB to run. Thus, remember to start up MongoDB if you want to run the tests locally. The tests include unit tests and integration tests. In order to run them, use this command line:

./run_all_tests.sh

A report will also be generated identifying any dependencies that need upgrading. This requires that you have defined CATALOGUE_DEPENDENCIES_URL as an environment variable pointing to the dependencies endpoint on the Tax Platform Catalogue's API.

Current Known Issues

In some use cases, specifically if this microservice is running locally, we may not want to make calls to AWS API Gateway. This can be disabled be entering application.conf and changing:

disableAwsCalls to true.

third-party-application's People

Contributors

andyspaven avatar cjrowe avatar lburgos avatar anjumabbas5 avatar adampridmore avatar petekirby-ee avatar peteslater-ee avatar robdawson-hmrc avatar fluentsynergydw avatar billymitchell14 avatar mattclark-zerogravit avatar rose-garratt avatar mattgreenuk avatar mi-akram avatar johnsgp avatar gurpreetbhamra avatar d6fb avatar tobias1087 avatar hmrc-web-operations avatar stewabel avatar jameshall1999 avatar srinivasalumunagala avatar lewismagri avatar matevans avatar nc-1234 avatar gokyo 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.