-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5682 from Skanetrafiken/67039-federated-identity-…
…service-bus Add configuration switch for Service Bus authentication with Federate…
- Loading branch information
Showing
21 changed files
with
495 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,197 @@ | ||
# Siri Azure Updater | ||
|
||
It is a sandbox extension developed by Skånetrafiken that allows OTP to fetch Siri ET & SX messages through *Azure Service Bus*. | ||
It also allows for OTP to download historical real-time data from an HTTP endpoint on startup. | ||
|
||
## Contact Info | ||
|
||
Skånetrafiken, Sweden | ||
developer.otp@skanetrafiken.se | ||
|
||
## Documentation | ||
|
||
Documentation available [here](../../examples/skanetrafiken/Readme.md). | ||
|
||
## Configuration | ||
|
||
To enable the SIRI updater you need to add it to the updaters section of the `router-config.json`. | ||
|
||
### Siri Azure ET Updater | ||
|
||
<!-- siri-azure-et-updater BEGIN --> | ||
<!-- NOTE! This section is auto-generated. Do not change, change doc in code instead. --> | ||
|
||
| Config Parameter | Type | Summary | Req./Opt. | Default Value | Since | | ||
|------------------------------------------------------------|:---------:|----------------------------------------------------------------|:----------:|---------------------|:-----:| | ||
| type = "siri-azure-et-updater" | `enum` | The type of the updater. | *Required* | | 1.5 | | ||
| [authenticationType](#u__11__authenticationType) | `enum` | Which authentication type to use | *Optional* | `"sharedaccesskey"` | 2.5 | | ||
| [customMidnight](#u__11__customMidnight) | `integer` | Time on which time breaks into new day. | *Optional* | `0` | 2.2 | | ||
| feedId | `string` | The ID of the feed to apply the updates to. | *Optional* | | 2.2 | | ||
| [fullyQualifiedNamespace](#u__11__fullyQualifiedNamespace) | `string` | Service Bus fully qualified namespace used for authentication. | *Optional* | | 2.5 | | ||
| fuzzyTripMatching | `boolean` | Whether to apply fuzzyTripMatching on the updates | *Optional* | `false` | 2.2 | | ||
| [servicebus-url](#u__11__servicebus_url) | `string` | Service Bus connection used for authentication. | *Optional* | | 2.2 | | ||
| topic | `string` | Service Bus topic to connect to. | *Optional* | | 2.2 | | ||
| history | `object` | Configuration for fetching historical data on startup | *Optional* | | 2.2 | | ||
| fromDateTime | `string` | Datetime boundary for historical data | *Optional* | `"-P1D"` | 2.2 | | ||
| timeout | `integer` | Timeout in milliseconds | *Optional* | `300000` | na | | ||
| url | `string` | Endpoint to fetch from | *Optional* | | na | | ||
|
||
|
||
##### Parameter details | ||
|
||
<h4 id="u__11__authenticationType">authenticationType</h4> | ||
|
||
**Since version:** `2.5` ∙ **Type:** `enum` ∙ **Cardinality:** `Optional` ∙ **Default value:** `"sharedaccesskey"` | ||
**Path:** /updaters/[11] | ||
**Enum values:** `sharedaccesskey` | `federatedidentity` | ||
|
||
Which authentication type to use | ||
|
||
<h4 id="u__11__customMidnight">customMidnight</h4> | ||
|
||
**Since version:** `2.2` ∙ **Type:** `integer` ∙ **Cardinality:** `Optional` ∙ **Default value:** `0` | ||
**Path:** /updaters/[11] | ||
|
||
Time on which time breaks into new day. | ||
|
||
It is common that operating day date breaks a little bit later than midnight so that the switch happens when traffic is at the lowest point. Parameter uses 24-hour format. If the switch happens on 4 am then set this field to 4. | ||
|
||
<h4 id="u__11__fullyQualifiedNamespace">fullyQualifiedNamespace</h4> | ||
|
||
**Since version:** `2.5` ∙ **Type:** `string` ∙ **Cardinality:** `Optional` | ||
**Path:** /updaters/[11] | ||
|
||
Service Bus fully qualified namespace used for authentication. | ||
|
||
Has to be present for authenticationMethod FederatedIdentity. | ||
|
||
<h4 id="u__11__servicebus_url">servicebus-url</h4> | ||
|
||
**Since version:** `2.2` ∙ **Type:** `string` ∙ **Cardinality:** `Optional` | ||
**Path:** /updaters/[11] | ||
|
||
Service Bus connection used for authentication. | ||
|
||
Has to be present for authenticationMethod SharedAccessKey. This should be Primary/Secondary connection string from service bus. | ||
|
||
|
||
|
||
##### Example configuration | ||
|
||
```JSON | ||
// router-config.json | ||
{ | ||
"updaters" : [ | ||
{ | ||
"type" : "siri-azure-et-updater", | ||
"topic" : "some_topic", | ||
"authenticationType" : "SharedAccessKey", | ||
"fullyQualifiedNamespace" : "fully_qualified_namespace", | ||
"servicebus-url" : "service_bus_url", | ||
"feedId" : "feed_id", | ||
"customMidnight" : 4, | ||
"history" : { | ||
"url" : "endpoint_url", | ||
"fromDateTime" : "-P1D", | ||
"timeout" : 300000 | ||
} | ||
} | ||
] | ||
} | ||
``` | ||
|
||
<!-- siri-azure-et-updater END --> | ||
|
||
### Siri Azure SX Updater | ||
|
||
<!-- siri-azure-sx-updater BEGIN --> | ||
<!-- NOTE! This section is auto-generated. Do not change, change doc in code instead. --> | ||
|
||
| Config Parameter | Type | Summary | Req./Opt. | Default Value | Since | | ||
|------------------------------------------------------------|:---------:|----------------------------------------------------------------|:----------:|---------------------|:-----:| | ||
| type = "siri-azure-sx-updater" | `enum` | The type of the updater. | *Required* | | 1.5 | | ||
| [authenticationType](#u__10__authenticationType) | `enum` | Which authentication type to use | *Optional* | `"sharedaccesskey"` | 2.5 | | ||
| [customMidnight](#u__10__customMidnight) | `integer` | Time on which time breaks into new day. | *Optional* | `0` | 2.2 | | ||
| feedId | `string` | The ID of the feed to apply the updates to. | *Optional* | | 2.2 | | ||
| [fullyQualifiedNamespace](#u__10__fullyQualifiedNamespace) | `string` | Service Bus fully qualified namespace used for authentication. | *Optional* | | 2.5 | | ||
| fuzzyTripMatching | `boolean` | Whether to apply fuzzyTripMatching on the updates | *Optional* | `false` | 2.2 | | ||
| [servicebus-url](#u__10__servicebus_url) | `string` | Service Bus connection used for authentication. | *Optional* | | 2.2 | | ||
| topic | `string` | Service Bus topic to connect to. | *Optional* | | 2.2 | | ||
| history | `object` | Configuration for fetching historical data on startup | *Optional* | | 2.2 | | ||
| fromDateTime | `string` | Datetime boundary for historical data. | *Optional* | `"-P1D"` | 2.2 | | ||
| timeout | `integer` | Timeout in milliseconds | *Optional* | `300000` | na | | ||
| toDateTime | `string` | Datetime boundary for historical data. | *Optional* | `"P1D"` | 2.2 | | ||
| url | `string` | Endpoint to fetch from | *Optional* | | na | | ||
|
||
|
||
##### Parameter details | ||
|
||
<h4 id="u__10__authenticationType">authenticationType</h4> | ||
|
||
**Since version:** `2.5` ∙ **Type:** `enum` ∙ **Cardinality:** `Optional` ∙ **Default value:** `"sharedaccesskey"` | ||
**Path:** /updaters/[10] | ||
**Enum values:** `sharedaccesskey` | `federatedidentity` | ||
|
||
Which authentication type to use | ||
|
||
<h4 id="u__10__customMidnight">customMidnight</h4> | ||
|
||
**Since version:** `2.2` ∙ **Type:** `integer` ∙ **Cardinality:** `Optional` ∙ **Default value:** `0` | ||
**Path:** /updaters/[10] | ||
|
||
Time on which time breaks into new day. | ||
|
||
It is common that operating day date breaks a little bit later than midnight so that the switch happens when traffic is at the lowest point. Parameter uses 24-hour format. If the switch happens on 4 am then set this field to 4. | ||
|
||
<h4 id="u__10__fullyQualifiedNamespace">fullyQualifiedNamespace</h4> | ||
|
||
**Since version:** `2.5` ∙ **Type:** `string` ∙ **Cardinality:** `Optional` | ||
**Path:** /updaters/[10] | ||
|
||
Service Bus fully qualified namespace used for authentication. | ||
|
||
Has to be present for authenticationMethod FederatedIdentity. | ||
|
||
<h4 id="u__10__servicebus_url">servicebus-url</h4> | ||
|
||
**Since version:** `2.2` ∙ **Type:** `string` ∙ **Cardinality:** `Optional` | ||
**Path:** /updaters/[10] | ||
|
||
Service Bus connection used for authentication. | ||
|
||
Has to be present for authenticationMethod SharedAccessKey. This should be Primary/Secondary connection string from service bus. | ||
|
||
|
||
|
||
##### Example configuration | ||
|
||
```JSON | ||
// router-config.json | ||
{ | ||
"updaters" : [ | ||
{ | ||
"type" : "siri-azure-sx-updater", | ||
"topic" : "some_topic", | ||
"servicebus-url" : "service_bus_url", | ||
"feedId" : "feed_id", | ||
"customMidnight" : 4, | ||
"history" : { | ||
"url" : "endpoint_url", | ||
"fromDateTime" : "-P1D", | ||
"toDateTime" : "P1D", | ||
"timeout" : 300000 | ||
} | ||
} | ||
] | ||
} | ||
``` | ||
|
||
<!-- siri-azure-sx-updater END --> | ||
|
||
## Changelog | ||
- Added configuration for turning off stop arrival time match feature. | ||
- Initial version (April 2022) | ||
- Minor changes in logging (November 2022) | ||
- Retry fetch from history endpoint if it failed (February 2023) | ||
- Solve a bug in SiriAzureETUpdater and improve error logging (March 2023) | ||
- Add support with federated identity authentication (February 2024) |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 6 additions & 0 deletions
6
src/ext/java/org/opentripplanner/ext/siri/updater/azure/AuthenticationType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package org.opentripplanner.ext.siri.updater.azure; | ||
|
||
public enum AuthenticationType { | ||
SharedAccessKey, | ||
FederatedIdentity, | ||
} |
Oops, something went wrong.