Skip to content

Ensono/reform-api-standards

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

83 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Reform API standards

Build Status

This library contains a set of Spring Boot components used across HMCTS APIs.

SensitiveHeadersRequestTraceFilter

Removes sensitive headers before they are added to Spring trace.
In order to use this filter declare the following Bean in your app:

@Bean
public RequestTraceFilter requestTraceFilter(TraceRepository traceRepository, TraceProperties traceProperties) {
    return new RequestTraceFilter(traceRepository, traceProperties, <your_custom_headers_go_here>);
}

@APIDeprecated

An annotation for controller classes and methods that adds warning headers to the responses generated by the API.

A typical usage would be to add the @APIDeprecated annotation to a method as in the following example:

@APIDeprecated(
    name = "Deprecated Endpoint",
    expiryDate = "2018-06-30",
    docLink = "https://example.org/docs/foo",
    note = "Some note."
)
public Model someAction() {
    // request handling code ...
}

The annotation has the attributes that are used for forming a Warning header.

  • name for friendly name of the endpoint,
  • expiryDate for the date which the endpoint will cease to serve,
  • docLink for the details of documentation regarding the API updates
  • note for optional notes to the clients

A sample of the Warning header is as follows:

The UserProfileEndpoint is deprecated and will be removed by 2018-06-30. Please see https://example.org/docs/foo for details. Some note.

About

HMCTS Spring Boot components

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Java 100.0%