Skip to content

Commit a85c2ca

Browse files
authored
merge develop into main (#67)
2 parents 91f0c1c + 2083eff commit a85c2ca

File tree

5 files changed

+30
-22
lines changed

5 files changed

+30
-22
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

77
## [Unreleased]
8+
[2.4.2] - 2024-04-01
9+
### Fixed
10+
- Fix add to webtools blacklist [#65](https://github.com/rokwire/gateway-building-block/issues/65)
11+
812
[2.4.1] - 2024-04-01
913
### Fixed
1014
- Fix webtools blacklist APIs [#62](https://github.com/rokwire/gateway-building-block/issues/62)

SECURITY.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
Patches for **Gateway Building Block** in this repository will only be applied to the following versions:
55
| Version | Supported |
66
| ------- | ------------------ |
7-
| 2.4.1 | :white_check_mark: |
8-
| < 2.4.1 | :x: |
7+
| 2.4.2 | :white_check_mark: |
8+
| < 2.4.2 | :x: |
99

1010
## Reporting a Bug or Vulnerability
1111

driven/storage/adapter.go

+22-18
Original file line numberDiff line numberDiff line change
@@ -371,28 +371,32 @@ func (a *Adapter) FindAllLegacyEvents() ([]model.LegacyEvent, error) {
371371

372372
// AddWebtoolsBlacklistData update data from the database
373373
func (a *Adapter) AddWebtoolsBlacklistData(dataSourceIDs []string, dataCalendarIDs []string) error {
374-
filterSource := bson.M{"name": "webtools_events_ids"}
375-
updateSource := bson.M{
376-
"$addToSet": bson.M{
377-
"data": bson.M{"$each": dataSourceIDs},
378-
},
379-
}
374+
if dataSourceIDs != nil {
375+
filterSource := bson.M{"name": "webtools_events_ids"}
376+
updateSource := bson.M{
377+
"$addToSet": bson.M{
378+
"data": bson.M{"$each": dataSourceIDs},
379+
},
380+
}
380381

381-
_, err := a.db.webtoolsBlacklistItems.UpdateOne(a.context, filterSource, updateSource, nil)
382-
if err != nil {
383-
return errors.WrapErrorAction(logutils.ActionUpdate, model.TypeExample, filterArgs(filterSource), err)
382+
_, err := a.db.webtoolsBlacklistItems.UpdateOne(a.context, filterSource, updateSource, nil)
383+
if err != nil {
384+
return errors.WrapErrorAction(logutils.ActionUpdate, "", filterArgs(filterSource), err)
385+
}
384386
}
387+
if dataCalendarIDs != nil {
388+
filterCalendar := bson.M{"name": "webtools_calendar_ids"}
389+
updateCalendar := bson.M{
390+
"$addToSet": bson.M{
391+
"data": bson.M{"$each": dataCalendarIDs},
392+
},
393+
}
385394

386-
filterCalendar := bson.M{"name": "webtools_calendar_ids"}
387-
updateCalendar := bson.M{
388-
"$addToSet": bson.M{
389-
"data": bson.M{"$each": dataCalendarIDs},
390-
},
391-
}
395+
_, err := a.db.webtoolsBlacklistItems.UpdateOne(a.context, filterCalendar, updateCalendar, nil)
396+
if err != nil {
397+
return errors.WrapErrorAction(logutils.ActionUpdate, "", filterArgs(filterCalendar), err)
398+
}
392399

393-
_, err = a.db.webtoolsBlacklistItems.UpdateOne(a.context, filterCalendar, updateCalendar, nil)
394-
if err != nil {
395-
return errors.WrapErrorAction(logutils.ActionUpdate, model.TypeExample, filterArgs(filterCalendar), err)
396400
}
397401

398402
return nil

driver/web/docs/gen/def.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ openapi: 3.0.3
22
info:
33
title: Rokwire Gateway Building Block API
44
description: Gateway Building Block API Documentation
5-
version: 2.4.1
5+
version: 2.4.2
66
servers:
77
- url: 'https://api.rokwire.illinois.edu/gateway'
88
description: Production server

driver/web/docs/index.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ openapi: 3.0.3
22
info:
33
title: Rokwire Gateway Building Block API
44
description: Gateway Building Block API Documentation
5-
version: 2.4.1
5+
version: 2.4.2
66
servers:
77
- url: 'https://api.rokwire.illinois.edu/gateway'
88
description: Production server

0 commit comments

Comments
 (0)