Skip to content

Commit

Permalink
Release v0.4.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
outofcoffee committed Nov 1, 2020
1 parent 37000a1 commit 79db9e4
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]
## [0.4.0] - 2020-11-01
### Added
- Adds the ability to specify policies and configuration that should be present on every API.

Expand Down
62 changes: 62 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,68 @@ The same goes for properties - you can define them in the _shared_ section and r

See the [shared-properties.yml](examples/declarative/shared-properties.yml) example file.

### Common policies for all APIs in an organisation

You can ensure all APIs in an organisation have a particular set of policies using the `org/common/policies` block.

Policies from the common block will be appended/prepended to the list of policies on each API in the organisation. Use the `first` and `last` lists to choose where to add the common policies in the policy chain.

```
org:
name: "test"
description: "Test organisation"
# Configuration and policies in the common org section are applied to each API.
common:
# Common policies are injected at either the start or the end of the policy chain for each API.
policies:
first:
- "alwaysFirstPolicy"
last:
- "alwaysLastPolicy"
apis:
- name: "example"
description: "Example API"
version: "1.0"
published: true
config:
endpoint: "http://example.com"
endpointType: "rest"
public: true
gateway: "test-gw"
# policies from the common block will be appended/prepended to this list
policies: []
```

See [examples/declarative/common-api-config.yaml] for an example.

### Common configuration for all APIs in an organisation

You can ensure all APIs in an organisation have particular configuration using the `org/common/config` block:

```
org:
name: "test"
description: "Test organisation"
# Configuration and policies in the common org section are applied to each API.
common:
# Common configuration is overridden by API specific values.
config:
endpointType: "rest"
public: true
gateway: "test-gw"
apis:
- name: "example"
description: "Example API"
version: "1.0"
published: true
config:
endpoint: "http://example.com"
policies:
# ... policies go here
```

See [examples/declarative/common-api-config.yaml] for an example.

# Requirements

* An instance of [apiman](http://apiman.io)
Expand Down
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*
* Copyright 2016 Pete Cornish
* Copyright 2020 Pete Cornish
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
Expand All @@ -19,7 +19,7 @@ plugins {
}

group 'io.apiman.cli'
version '0.3.3-SNAPSHOT'
version '0.4.0'

apply plugin: 'java'

Expand Down
1 change: 1 addition & 0 deletions examples/declarative/common-api-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,5 @@ org:
published: true
config:
endpoint: "http://example.com"
# policies from the common block will be appended/prepended to this list
policies: []

0 comments on commit 79db9e4

Please sign in to comment.