A small dropwizard bundle to filter resources based on mode supplied
This bundle essentially restricts/allows the API based on mode supplied
READ_ONLY
GET resourcesREAD_WRITE
POST method, cases when we have a request body for filter params and so on. In these scenarios you can annotate specific resource with @ReadOnlyAPI which discounts the HttpMethod and allows all requests even incase of READ_ONLY mode.Add the repository
<repository>
<id>clojars</id>
<name>Clojars repository</name>
<url>https://clojars.org/repo</url>
</repository>
Add the dependency
<dependency>
<groupId>com.chaitanyachavali.dropwizard</groupId>
<artifactId>dropwizard-filters-bundle</artifactId>
<version>1.0.0</version>
</dependency>
Add the bundle to your application
@Override
public void initialize(Bootstrap bootstrap) {
bootstrap.addBundle(new ResourceFilterBundle<ApplicationConfiguration>() {
@Override
public FilterMode withMode(ApplicationConfiguration conf) {
return conf.getFilterMode();
}
});
}
Can you improve this documentation? These fine people already did:
chaitanyachavali & Chaitanya ReddyEdit on GitHub
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |