-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FEC-14248-fix-_isAnonimous-based-on-ks-contain-user-providers
- Loading branch information
Roee Dean
authored and
Roee Dean
committed
Feb 8, 2025
1 parent
31ef303
commit 3bd685c
Showing
6 changed files
with
210 additions
and
160 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
src/k-provider/ovp/response-types/kaltura-user-get-response.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
export class KalturaUserGetResponse { | ||
public id: string; | ||
private static readonly INVALID_IDS = ['0', '', null, undefined]; | ||
|
||
constructor(response: any) { | ||
this.id = response.id; | ||
} | ||
|
||
public isAnonymous(): boolean { | ||
return KalturaUserGetResponse.INVALID_IDS.includes(this.id); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import OVPService from './ovp-service'; | ||
import RequestBuilder from '../../../util/request-builder'; | ||
|
||
const SERVICE_NAME: string = 'user'; | ||
|
||
export default class OVPUserService extends OVPService { | ||
/** | ||
* Creates an instance of RequestBuilder for user.get | ||
* @function getPlaybackContext | ||
* @param {string} serviceUrl The service base URL | ||
* @param {string} ks The ks | ||
* @returns {RequestBuilder} The request builder | ||
* @static | ||
*/ | ||
public static get(serviceUrl: string, ks: string): RequestBuilder { | ||
const headers: Map<string, string> = new Map(); | ||
headers.set('Content-Type', 'application/json'); | ||
const request = new RequestBuilder(headers); | ||
request.service = SERVICE_NAME; | ||
request.action = 'get'; | ||
request.method = 'POST'; | ||
request.url = request.getUrl(serviceUrl); | ||
request.tag = 'user-get'; | ||
request.params = { ks: ks, format: 1 }; | ||
return request; | ||
} | ||
} |
Oops, something went wrong.