Skip to content

Conversation

@rkreich
Copy link
Collaborator

@rkreich rkreich commented Sep 18, 2025

No description provided.

@github-actions
Copy link

@github-copilot suggest

@rkreich rkreich requested a review from Copilot September 18, 2025 13:50
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements support for multiple URL token secrets to enhance token validation flexibility. The changes allow the system to maintain backwards compatibility while supporting multiple secret values for URL token generation and validation.

Key changes:

  • Modified token generation to use the current secret from a collection of secrets
  • Updated token validation to check against all available secrets instead of just one

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
alpha/lib/model/flavorAsset.php Updates token generation to use getCurrentSecret() instead of get()
alpha/apps/kaltura/modules/extwidget/actions/playManifestAction.class.php Enhances token validation to iterate through all available secrets

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

$secrets = kConf::getAllSecrets('url_token_secret');
foreach ($secrets as $secret) {
$calcToken = sha1($secret . $url);
if ($calcToken == $urlToken) {
Copy link

Copilot AI Sep 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use strict comparison (===) instead of loose comparison (==) for token validation to prevent type juggling attacks and ensure exact string matching.

Suggested change
if ($calcToken == $urlToken) {
if ($calcToken === $urlToken) {

Copilot uses AI. Check for mistakes.
@rkreich rkreich force-pushed the PLAT-25493-RemoteAddrHeaderSalt branch from 17644a7 to b08727c Compare November 3, 2025 14:38
@rkreich rkreich force-pushed the PLAT-25496-UrlTokenSecret branch from c3a6d8f to b330ea4 Compare November 3, 2025 14:39
@github-actions
Copy link

github-actions bot commented Nov 3, 2025

@github-copilot suggest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants