-
Notifications
You must be signed in to change notification settings - Fork 41
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
feat: typed publications in gateways/peripheraldevices SOFIE-1183 #1056
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## release51 #1056 +/- ##
=============================================
+ Coverage 58.20% 58.36% +0.15%
=============================================
Files 507 507
Lines 81414 81475 +61
Branches 4279 4398 +119
=============================================
+ Hits 47391 47552 +161
+ Misses 33965 33877 -88
+ Partials 58 46 -12
☔ View full report in Codecov by Sentry. |
8fc02e9
to
e9286d6
Compare
meteorPublish( | ||
PeripheralDevicePubSub.expectedPlayoutItemsForDevice, | ||
async function (deviceId: PeripheralDeviceId, token: string | undefined) { | ||
if (!deviceId) throw new Meteor.Error(400, 'deviceId argument missing') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this publication use a better authentication? Like in PeripheralDevicePubSub.rundownsForDevice
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this publication can do anything else. The mongo collection doesnt have an organisationId
, the only filter we can use is for the studio.
The peripheralDeviceContent
check seems to be the most relevant thing to check here, as it is documented as Check for read access for all peripheraldevice content (commands, mediaWorkFlows, etc..)
But I didn't put that much thought into it, as I know that if anyone wants to enable the security, various other methods need fixing to work at all, and the rest need auditing as they can leak data in various ways.
In fact, I would question if rundownsForDevice
is a good example. The deviceId
parameter there is not even being used
feature
Subscribing to publications in peripheraldevices is loosely typed, and requires each gateway to know the type of each collection it is accessing.
the
PubSub
enum has been split up to reflect what is available at different levels, and each gateway is able to define what subset it wants to access, resulting in the correct typings being available for publications.One portion resides in
shared-lib
, and is available to all peripheral devices (and is the default, unless they specify another set).Another portion resides in
corelib
, and contains publications for the Rundown/RundownPlaylist and its contents. This is intended to be used by the live-status gateway.The final portion resides in the old location, and is intended to be used solely by the Meteor UI. The Meteor UI also has access to the rest of the publication types.
As part of this, some typings had to be adjusted inside LSG to make the compiler happy, resulting in it having some more usage of our id types, and some additional generics to get the publications typed properly.
Additionally, the
observe
method in server-core-integration has been made typed to match the collections. This did not have much impact and has improved type safetyI have prototyped the required changes for package-manager and input-gateway, PRs will be raised when this gets merged.
Status