Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: institution ids in dts allow list #609

Merged
merged 4 commits into from
Dec 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.7.1] - 2023-12-12

- feat: added allow list by institution for `dts` plugin

## [1.7.0] - 2023-10-27

- refactor: drop `contentId` mapping from `dts` plugin
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ard-eventhub",
"version": "1.7.0",
"version": "1.7.1",
"description": "ARD system to distribute real-time (live) metadata for primarily radio broadcasts.",
"main": "./src/ingest/index.js",
"engines": {
Expand Down
8 changes: 5 additions & 3 deletions src/ingest/events/post.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ const DEFAULT_ZONE = 'Europe/Berlin'

// feature flags
const IS_COMMON_TOPIC_ENABLED = true
// allow DTS for SWR (a3004ff924ece1a2) and BR (95a02eb6cc4f3d59)
const DTS_INSTITUTION_ALLOW_LIST = ['urn:ard:institution:a3004ff924ece1a2', 'urn:ard:institution:95a02eb6cc4f3d59']
// allow DTS for SWR (baa7e9a52223a090) and BR (7d64899d03610af2)
const DTS_INSTITUTION_ALLOW_LIST = ['urn:ard:institution:baa7e9a52223a090', 'urn:ard:institution:7d64899d03610af2']

module.exports = async (req, res) => {
try {
Expand Down Expand Up @@ -131,7 +131,9 @@ module.exports = async (req, res) => {
// add opt-out plugins
const isDtsPluginSet = message.plugins?.find((plugin) => plugin.type === 'dts')
const isMusic = req.body.type === 'music'
if (!isDtsPluginSet && isMusic && DTS_INSTITUTION_ALLOW_LIST.includes(req.user.institutionId)) {
const isInDtsAllowList = DTS_INSTITUTION_ALLOW_LIST.includes(req.user.institutionId)

if (!isDtsPluginSet && isMusic && isInDtsAllowList) {
message.plugins.push({
type: 'dts',
isDeactivated: false,
Expand Down