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: stream property of request context obfuscated in production builds #5118

Merged
merged 41 commits into from
Mar 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
90b4527
Merge remote-tracking branch 'upstream/master'
dsparacio Oct 29, 2020
49d611f
Merge branch 'master' of https://github.com/google/shaka-player
dsparacio Jan 25, 2021
93fdcd3
Merge remote-tracking branch 'upstream/master'
littlespex May 4, 2021
0b7ac5b
Merge branch 'google:master' into master
littlespex Sep 8, 2021
6db0e3c
Merge branch 'google:master' into master
littlespex Sep 15, 2021
efaebee
Merge branch 'google:master' into master
littlespex Sep 20, 2021
7fed0d0
Merge branch 'google:master' into master
littlespex Sep 22, 2021
7a30028
Merge branch 'google:master' into master
littlespex Sep 30, 2021
0168a7f
Merge branch 'google:master' into master
littlespex Oct 18, 2021
6b64092
Merge branch 'google:master' into master
littlespex Nov 2, 2021
a0cdf79
Merge branch 'google:master' into master
littlespex Dec 16, 2021
28564dd
Merge branch 'google:master' into master
littlespex Jan 7, 2022
5fb344e
Merge branch 'google:master' into master
littlespex Jan 10, 2022
1766930
Merge branch 'google:master' into master
littlespex Jan 12, 2022
b0cad7c
Merge branch 'google:master' into master
littlespex Jan 18, 2022
868b75b
Merge branch 'google:master' into master
littlespex Feb 4, 2022
95589c9
Merge branch 'shaka-project:main' into master
littlespex Mar 15, 2022
f331382
Merge branch 'shaka-project:main' into master
littlespex Jun 13, 2022
d14c111
Merge branch 'shaka-project:main' into master
littlespex Jun 29, 2022
b700d3b
Merge branch 'shaka-project:main' into master
littlespex Sep 21, 2022
0d9ea95
Merge branch 'shaka-project:main' into master
littlespex Oct 21, 2022
ef5177b
Merge branch 'shaka-project:main' into master
littlespex Oct 25, 2022
937638e
Merge branch 'shaka-project:main' into master
littlespex Oct 26, 2022
6f0d4fe
Merge branch 'shaka-project:main' into master
littlespex Oct 27, 2022
5a83556
Merge branch 'shaka-project:main' into master
littlespex Nov 9, 2022
6536603
Merge branch 'shaka-project:main' into master
littlespex Nov 10, 2022
62f7011
Merge branch 'shaka-project:main' into master
littlespex Nov 16, 2022
0e4d4a2
Merge branch 'shaka-project:main' into master
littlespex Nov 17, 2022
bfa45d3
Merge branch 'shaka-project:main' into master
littlespex Dec 9, 2022
f911668
Merge branch 'shaka-project:main' into master
littlespex Jan 21, 2023
5291a2a
Merge branch 'shaka-project:main' into master
littlespex Jan 25, 2023
dc64ede
Merge branch 'shaka-project:main' into master
littlespex Jan 26, 2023
7bee999
fix: exclude "future" segments from presentation timeline calculations
littlespex Jan 26, 2023
172fb81
Revert "fix: exclude "future" segments from presentation timeline cal…
littlespex Jan 26, 2023
127b183
fix: exclude "future" segments from presentation timeline calculations
littlespex Jan 26, 2023
7004b44
Revert "fix: exclude "future" segments from presentation timeline cal…
littlespex Jan 26, 2023
2632ea9
Merge branch 'shaka-project:main' into master
littlespex Feb 17, 2023
407a446
Merge branch 'shaka-project:main' into master
littlespex Mar 7, 2023
4dd2eff
Merge branch 'shaka-project:main' into master
littlespex Mar 23, 2023
afe24d1
fix: move RequestContext to externs
littlespex Mar 23, 2023
796590f
fix: change export to exportDoc tag
littlespex Mar 23, 2023
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
25 changes: 23 additions & 2 deletions externs/shaka/net.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,27 @@ shaka.extern.ProgressUpdated;
shaka.extern.HeadersReceived;


/**
* @typedef {{
* type: (shaka.net.NetworkingEngine.AdvancedRequestType|undefined),
* stream: (shaka.extern.Stream|undefined),
* segment: (shaka.media.SegmentReference|undefined)
* }}
*
* @description
* Defines contextual data about a request
*
* @property {shaka.net.NetworkingEngine.AdvancedRequestType=} type
* The advanced type
* @property {shaka.extern.Stream=} stream
* The duration of the segment in seconds
* @property {shaka.media.SegmentReference=} segment
* The request's segment reference
* @exportDoc
*/
shaka.extern.RequestContext;


/**
* Defines a filter for requests. This filter takes the request and modifies
* it before it is sent to the scheme plugin.
Expand All @@ -211,7 +232,7 @@ shaka.extern.HeadersReceived;
*
* @typedef {!function(shaka.net.NetworkingEngine.RequestType,
* shaka.extern.Request,
* shaka.net.NetworkingEngine.RequestContext=):
* shaka.extern.RequestContext=):
* (Promise|undefined)}
* @exportDoc
*/
Expand All @@ -228,7 +249,7 @@ shaka.extern.RequestFilter;
*
* @typedef {!function(shaka.net.NetworkingEngine.RequestType,
* shaka.extern.Response,
* shaka.net.NetworkingEngine.RequestContext=):
* shaka.extern.RequestContext=):
* (Promise|undefined)}
* @exportDoc
*/
Expand Down
2 changes: 1 addition & 1 deletion lib/hls/hls_parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -3386,7 +3386,7 @@ shaka.hls.HlsParser = class {
*
* @param {shaka.extern.Request} request
* @param {shaka.net.NetworkingEngine.RequestType} type
* @param {shaka.net.NetworkingEngine.RequestContext=} context
* @param {shaka.extern.RequestContext=} context
* @return {!Promise.<shaka.extern.Response>}
* @private
*/
Expand Down
31 changes: 5 additions & 26 deletions lib/net/networking_engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
*/

goog.provide('shaka.net.NetworkingEngine');
goog.provide('shaka.net.NetworkingEngine.AdvancedRequestType');
goog.provide('shaka.net.NetworkingEngine.RequestType');
goog.provide('shaka.net.NetworkingEngine.PendingRequest');

goog.require('goog.Uri');
goog.require('goog.asserts');
goog.require('shaka.media.SegmentReference');
goog.require('shaka.net.Backoff');
goog.require('shaka.util.AbortableOperation');
goog.require('shaka.util.BufferUtils');
Expand Down Expand Up @@ -254,7 +254,7 @@ shaka.net.NetworkingEngine = class extends shaka.util.FakeEventTarget {
*
* @param {shaka.net.NetworkingEngine.RequestType} type
* @param {shaka.extern.Request} request
* @param {shaka.net.NetworkingEngine.RequestContext=} context
* @param {shaka.extern.RequestContext=} context
* @return {!shaka.net.NetworkingEngine.PendingRequest}
* @export
*/
Expand Down Expand Up @@ -349,7 +349,7 @@ shaka.net.NetworkingEngine = class extends shaka.util.FakeEventTarget {
/**
* @param {shaka.net.NetworkingEngine.RequestType} type
* @param {shaka.extern.Request} request
* @param {shaka.net.NetworkingEngine.RequestContext=} context
* @param {shaka.extern.RequestContext=} context
* @return {!shaka.util.AbortableOperation.<undefined>}
* @private
*/
Expand Down Expand Up @@ -624,7 +624,7 @@ shaka.net.NetworkingEngine = class extends shaka.util.FakeEventTarget {
* @param {shaka.net.NetworkingEngine.RequestType} type
* @param {shaka.net.NetworkingEngine.ResponseAndGotProgress}
* responseAndGotProgress
* @param {shaka.net.NetworkingEngine.RequestContext=} context
* @param {shaka.extern.RequestContext=} context
* @return {!shaka.extern.IAbortableOperation.<
* shaka.net.NetworkingEngine.ResponseAndGotProgress>}
* @private
Expand Down Expand Up @@ -845,27 +845,6 @@ shaka.net.NetworkingEngine.schemes_ = {};
shaka.net.NetworkingEngine.ResponseAndGotProgress;


/**
* @typedef {{
* type: (shaka.net.NetworkingEngine.AdvancedRequestType|undefined),
* stream: (shaka.extern.Stream|undefined),
* segment: (shaka.media.SegmentReference|undefined)
* }}
*
* @description
* Defines contextual data about a request
*
* @property {shaka.net.NetworkingEngine.AdvancedRequestType=} type
* The advanced type
* @property {shaka.extern.Stream=} stream
* The duration of the segment in seconds
* @property {shaka.media.SegmentReference=} segment
* The request's segment reference
* @export
*/
shaka.net.NetworkingEngine.RequestContext;


/**
* @typedef {function(
* !Object.<string, string>,
Expand Down Expand Up @@ -899,7 +878,7 @@ shaka.net.NetworkingEngine.OnDownloadFailed;
* @typedef {function(
* !shaka.net.NetworkingEngine.RequestType,
* !shaka.extern.Request,
* (shaka.net.NetworkingEngine.RequestContext|undefined))}
* (shaka.extern.RequestContext|undefined))}
*
* @description
* A callback function called on every request
Expand Down
8 changes: 4 additions & 4 deletions lib/util/cmcd_manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ shaka.util.CmcdManager = class {
* The request type
* @param {!shaka.extern.Request} request
* The request to apply CMCD data to
* @param {shaka.net.NetworkingEngine.RequestContext=} context
* @param {shaka.extern.RequestContext=} context
* The request context
*/
applyData(type, request, context = {}) {
Expand Down Expand Up @@ -123,7 +123,7 @@ shaka.util.CmcdManager = class {
*
* @param {!shaka.extern.Request} request
* The request to apply CMCD data to
* @param {shaka.net.NetworkingEngine.RequestContext} context
* @param {shaka.extern.RequestContext} context
* The request context
*/
applyManifestData(request, context) {
Expand All @@ -150,7 +150,7 @@ shaka.util.CmcdManager = class {
* Apply CMCD data to a segment request
*
* @param {!shaka.extern.Request} request
* @param {shaka.net.NetworkingEngine.RequestContext} context
* @param {shaka.extern.RequestContext} context
* The request context
*/
applySegmentData(request, context) {
Expand Down Expand Up @@ -349,7 +349,7 @@ shaka.util.CmcdManager = class {
/**
* The CMCD object type.
*
* @param {shaka.net.NetworkingEngine.RequestContext} context
* @param {shaka.extern.RequestContext} context
* The request context
* @private
*/
Expand Down
12 changes: 6 additions & 6 deletions lib/util/fairplay_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ shaka.util.FairPlayUtils = class {
*
* @param {shaka.net.NetworkingEngine.RequestType} type
* @param {shaka.extern.Request} request
* @param {shaka.net.NetworkingEngine.RequestContext=} context
* @param {shaka.extern.RequestContext=} context
* @export
*/
static verimatrixFairPlayRequest(type, request, context) {
Expand All @@ -252,7 +252,7 @@ shaka.util.FairPlayUtils = class {
*
* @param {shaka.net.NetworkingEngine.RequestType} type
* @param {shaka.extern.Request} request
* @param {shaka.net.NetworkingEngine.RequestContext=} context
* @param {shaka.extern.RequestContext=} context
* @private
*/
static octetStreamFairPlayRequest_(type, request, context) {
Expand All @@ -267,7 +267,7 @@ shaka.util.FairPlayUtils = class {
*
* @param {shaka.net.NetworkingEngine.RequestType} type
* @param {shaka.extern.Request} request
* @param {shaka.net.NetworkingEngine.RequestContext=} context
* @param {shaka.extern.RequestContext=} context
* @export
*/
static ezdrmFairPlayRequest(type, request, context) {
Expand All @@ -279,7 +279,7 @@ shaka.util.FairPlayUtils = class {
*
* @param {shaka.net.NetworkingEngine.RequestType} type
* @param {shaka.extern.Request} request
* @param {shaka.net.NetworkingEngine.RequestContext=} context
* @param {shaka.extern.RequestContext=} context
* @export
*/
static conaxFairPlayRequest(type, request, context) {
Expand All @@ -291,7 +291,7 @@ shaka.util.FairPlayUtils = class {
*
* @param {shaka.net.NetworkingEngine.RequestType} type
* @param {shaka.extern.Request} request
* @param {shaka.net.NetworkingEngine.RequestContext=} context
* @param {shaka.extern.RequestContext=} context
* @export
*/
static expressplayFairPlayRequest(type, request, context) {
Expand All @@ -303,7 +303,7 @@ shaka.util.FairPlayUtils = class {
*
* @param {shaka.net.NetworkingEngine.RequestType} type
* @param {shaka.extern.Response} response
* @param {shaka.net.NetworkingEngine.RequestContext=} context
* @param {shaka.extern.RequestContext=} context
* @export
*/
static commonFairPlayResponse(type, response, context) {
Expand Down
8 changes: 4 additions & 4 deletions test/test/util/fake_networking_engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ shaka.test.FakeNetworkingEngine = class {
*
* @param {string} uri
* @param {shaka.net.NetworkingEngine.RequestType} type
* @param {shaka.net.NetworkingEngine.RequestContext=} context
* @param {shaka.extern.RequestContext=} context
*/
expectRequest(uri, type, context) {
shaka.test.FakeNetworkingEngine.expectRequest(
Expand All @@ -186,7 +186,7 @@ shaka.test.FakeNetworkingEngine = class {
*
* @param {string} uri
* @param {shaka.net.NetworkingEngine.RequestType} type
* @param {shaka.net.NetworkingEngine.RequestContext=} context
* @param {shaka.extern.RequestContext=} context
*/
expectNoRequest(uri, type, context) {
shaka.test.FakeNetworkingEngine.expectNoRequest(
Expand Down Expand Up @@ -294,7 +294,7 @@ shaka.test.FakeNetworkingEngine = class {
* @param {!Object} requestSpy
* @param {string} uri
* @param {shaka.net.NetworkingEngine.RequestType} type
* @param {shaka.net.NetworkingEngine.RequestContext=} context
* @param {shaka.extern.RequestContext=} context
*/
static expectRequest(requestSpy, uri, type, context) {
// Jasmine "toHaveBeenCalledWith" doesn't handle optional parameters well.
Expand All @@ -314,7 +314,7 @@ shaka.test.FakeNetworkingEngine = class {
* @param {!Object} requestSpy
* @param {string} uri
* @param {shaka.net.NetworkingEngine.RequestType} type
* @param {shaka.net.NetworkingEngine.RequestContext=} context
* @param {shaka.extern.RequestContext=} context
*/
static expectNoRequest(requestSpy, uri, type, context) {
// Jasmine "toHaveBeenCalledWith" doesn't handle optional parameters well.
Expand Down