diff --git a/packages/api/src/controllers/access-control.ts b/packages/api/src/controllers/access-control.ts index 38b7aa1f79..03cd114691 100644 --- a/packages/api/src/controllers/access-control.ts +++ b/packages/api/src/controllers/access-control.ts @@ -33,14 +33,14 @@ const app = Router(); type GateConfig = { refresh_interval: number; - rateLimit: number; + rate_limit: number; }; async function fireGateWebhook( webhook: DBWebhook, plabackPolicy: PlaybackPolicy, payload: AccessControlGatePayload, - isTrovoAuth: boolean + isPullStream: boolean ) { let timestamp = Date.now(); let jsonPayload = { @@ -63,7 +63,7 @@ async function fireGateWebhook( body: JSON.stringify(jsonPayload), }; - if (isTrovoAuth) { + if (isPullStream) { params.headers["Trovo-Auth-Version"] = "1.1"; } @@ -152,7 +152,7 @@ app.post( if (user.createdAt > HACKER_DISABLE_CUTOFF_DATE) { if (isFreeTierUser(user)) { - config.rateLimit = MAX_ALLOWED_VIEWERS_FOR_HACKER_TIER_PER_NODE; + config.rate_limit = MAX_ALLOWED_VIEWERS_FOR_HACKER_TIER_PER_NODE; } } @@ -257,7 +257,7 @@ app.post( webhook, content.playbackPolicy, gatePayload, - content.isTrovoAuth + content.isPullStream ); if (statusCode >= 200 && statusCode < 300) { diff --git a/packages/api/src/controllers/stream.ts b/packages/api/src/controllers/stream.ts index 8e5ca93872..b850c91771 100644 --- a/packages/api/src/controllers/stream.ts +++ b/packages/api/src/controllers/stream.ts @@ -1038,6 +1038,7 @@ app.put( profiles: req.config.defaultStreamProfiles, ...rawPayload, creatorId: mapInputCreatorId(rawPayload.creatorId), + isPullStream: true, }; const keyValue = _.get(payload, pullStreamKeyAccessors[key]); diff --git a/packages/api/src/schema/api-schema.yaml b/packages/api/src/schema/api-schema.yaml index 94cf6f12b3..c5868b7e9d 100644 --- a/packages/api/src/schema/api-schema.yaml +++ b/packages/api/src/schema/api-schema.yaml @@ -472,12 +472,12 @@ components: description: Used to form playback URL playbackPolicy: $ref: "#/components/schemas/playback-policy" - isTrovoAuth: + isPullStream: type: boolean readOnly: true description: >- - Wether the stream is authenticated by Trovo. If true, any webhook - policy will include the Trovo Auth header + Wether the stream is a pull stream. If true, any webhook policy will + include the Trovo Auth header profiles: type: array default: @@ -873,12 +873,12 @@ components: description: URL to manually download the asset if desired playbackPolicy: $ref: "#/components/schemas/playback-policy" - isTrovoAuth: + isPullStream: type: boolean readOnly: true description: >- - Wether the stream is authenticated by Trovo. If true, any webhook - policy will include the Trovo Auth header + Wether the stream is a pull stream. If true, any webhook policy will + include the Trovo Auth header source: oneOf: - additionalProperties: false