Skip to content

Commit

Permalink
Merge pull request #261 from Accenture/blacklist-i9n-test
Browse files Browse the repository at this point in the history
Add blacklist i9n test and fix some stuff along the way
  • Loading branch information
kevinbader authored Sep 18, 2019
2 parents 9b9bd23 + 6f06733 commit e4bc9f6
Show file tree
Hide file tree
Showing 44 changed files with 1,426 additions and 216 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added

- Added longpolling as new connection type [#217](https://github.com/Accenture/reactive-interaction-gateway/issues/217)
- When terminating an SSE connection after its associated session has been blacklisted, RIG now sends out a `rig.session_killed` event before closing the socket. For WebSocket connections, the closing frame contains "Session killed." as its payload.
- New API for querying and updating the session blacklist: `/v2/session-blacklist`, which introduces the following breaking changes:
- When a session has been added to the session blacklist successfully, the endpoint now uses the correct HTTP status code "201 Created" instead of "200 Ok".
- When using the API to blacklist a session, the `validityInSeconds` should now be passed as an integer value (using a string still works though).

<!-- ### Changed -->

Expand Down
3 changes: 2 additions & 1 deletion config/rig_api/config.exs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ config :rig, RigApi.Endpoint,
# Always start the HTTP endpoints on application startup:
config :phoenix, :serve_endpoints, true

config :rig, RigApi.ApisController, rig_proxy: RigInboundGateway.Proxy
config :rig, RigApi.V1.APIs, rig_proxy: RigInboundGateway.Proxy
config :rig, RigApi.V2.APIs, rig_proxy: RigInboundGateway.Proxy

config :rig, :event_filter, Rig.EventFilter

Expand Down
3 changes: 2 additions & 1 deletion config/rig_api/test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ config :rig, RigApi.Endpoint,
password: "test"
]

config :rig, RigApi.ApisController, rig_proxy: RigInboundGateway.ProxyMock
config :rig, RigApi.V1.APIs, rig_proxy: RigInboundGateway.ProxyMock
config :rig, RigApi.V2.APIs, rig_proxy: RigInboundGateway.ProxyMock

config :rig, :event_filter, Rig.EventFilterMock
10 changes: 5 additions & 5 deletions docs/api-gateway-management.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ You'll right away see list of all internal APIs.

## Create new API

`POST /v1/apis`
`POST /v2/apis`

```json
{
Expand Down Expand Up @@ -59,17 +59,17 @@ You'll right away see list of all internal APIs.

## Read list of APIs

`GET /v1/apis`
`GET /v2/apis`

This is also way how to check if your APIs were loaded properly.

## Read detail of specific API

`GET /v1/apis/:api_id`
`GET /v2/apis/:api_id`

## Update API

`PUT /v1/apis/:api_id`
`PUT /v2/apis/:api_id`

```json
{
Expand Down Expand Up @@ -105,4 +105,4 @@ This is also way how to check if your APIs were loaded properly.

## Delete API

`DELETE /v1/apis/:api_id`
`DELETE /v2/apis/:api_id`
2 changes: 1 addition & 1 deletion docs/api-gateway.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ Configuration of such API endpoint might look like this:
> Note the presence of `response_from` field. This tells RIG to wait for different event with the same correlation ID.
As an alternative you can set `response_from` to `http_async`. This means that correlated response has to be sent to internal `:4010/v1/responses` `POST` endpoint with a body like this:
As an alternative you can set `response_from` to `http_async`. This means that correlated response has to be sent to internal `:4010/v2/responses` `POST` endpoint with a body like this:
```json
{
Expand Down
2 changes: 1 addition & 1 deletion examples/channels-example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ curl -X "POST" \
-H "Content-Type: application/json" \
-d "{\"id\":\"kafka-service\",\"name\":\"kafka-service\",\"version_data\":{\"default\":{\"endpoints\":[{\"id\":\"kafka-producer-endpoint\",\"path\":\"/produce\",\"method\":\"POST\",\"secured\":false}]}},\"proxy\":{\"use_env\":false,\"target_url\":\"localhost\",\"port\":8000}}" \
--silent \
"http://localhost:7010/v1/apis"
"http://localhost:7010/v2/apis"
```

## Example scenarios to test
Expand Down
Loading

0 comments on commit e4bc9f6

Please sign in to comment.