-
Notifications
You must be signed in to change notification settings - Fork 225
feat(remote_signer): Add job token signing endpoint for byoc job types #3869
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
Open
eliteprox
wants to merge
46
commits into
master
Choose a base branch
from
feat/remote-signer-byoc
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
46 commits
Select commit
Hold shift + click to select a range
a1fac53
feat(remote_signer, orchestrator) Add external capabilities support t…
eliteprox ec501ab
Refactor ExternalCapabilityInfo: Remove PriceInfo field and related m…
eliteprox 4a889ef
Implement capabilities endpoint and refactor ExternalCapabilityInfo
eliteprox 85268d8
revert changes to gRPC
eliteprox df9275f
feat(capabilities): Add BYOC external capability and integrate pricin…
eliteprox 18472ac
refactor(capabilities): cleanup unnecessary capability changes
eliteprox 4d47903
Merge branch 'master' into feat/remote-signer-byoc
eliteprox deae93b
Merge branch 'master' into feat/remote-signer-byoc
eliteprox c500fc5
Merge branch 'master' into feat/remote-signer-byoc
eliteprox 7287b04
apply gofmt
eliteprox cf9ca75
Enhance BYOC capability validation in remote signer
eliteprox 9884e79
Refactor PriceInfo methods to simplify node checks and enhance BYOC p…
eliteprox a78e876
Merge branch 'master' into feat/remote-signer-byoc
eliteprox 947825a
Enhance BYOC job signing and payment processing
eliteprox 5f3d6be
Refactor job credential verification in BYOC orchestrator
eliteprox b08d680
Merge branch 'master' into feat/remote-signer-byoc
eliteprox ec6bd32
revert erroneous changes to pricing logic in orchestrator.go, fix tests
eliteprox 55ecbbc
revert removed comments
eliteprox a6b94a8
Update test for GetOrchestrator to assert empty capabilities prices i…
eliteprox a19eb98
Refactor pricing logic in orchestrator.go to remove unnecessary recip…
eliteprox 5342094
revert changes to byoc/stream_orchestrator.go
eliteprox 08bed0a
Refactor BYOC payment processing logic in remote_signer.go
eliteprox e90af90
Update JSON tag for ManifestID in RemotePaymentRequest struct in remo…
eliteprox b14f6ed
Refactor BYOC payment request validation and pricing resolution
eliteprox 60e9588
Update JSON tag for ManifestID in RemotePaymentRequest struct to lowe…
eliteprox cf89209
Remove unnecessary recipient check in priceInfo function of orchestra…
eliteprox ee93532
Remove error handling for capability prices retrieval in orchestrator…
eliteprox 8e0c947
Enhance BYOC payment handling and error reporting
eliteprox a5ba467
fix(tests): TestGetOrchestrator_CapabilitiesPricesError to allow Empt…
eliteprox cacec0d
refactor(remote_signer, byoc): Use Type param for capability instead …
eliteprox 61b0363
Enhance BYOC request validation and pricing resolution
eliteprox 20e763c
refactor(remote_signer): restore stream parameters to ensure proper e…
eliteprox b969c06
refactor(remote_signer): improve BYOC pricing resolution and test cases
eliteprox 07e30b7
refactor(remote_signer): optimize BYOC pre-funding logic for payment …
eliteprox 0222b67
refactor(remote_signer): consolidate remote type constants for clarity
eliteprox 8e5d724
refactor(remote_signer): enhance BYOC pricing resolution and testing
eliteprox 037a23c
refactor(remote_signer): streamline manifest ID handling in payment g…
eliteprox 9561497
refactor(remote_signer): improve BYOC pricing resolution and error ha…
eliteprox a62177b
refactor(remote_signer): remove unused payment type validation function
eliteprox 30d9ee0
refactor(orchestrator): revert changes to priceInfo function
eliteprox 3f13060
refactor(remote_signer): simplify billable seconds calculation in pay…
eliteprox 0a1919e
refactor(remote_signer): remove deprecated BYOC pricing resolution logic
eliteprox e7e924d
Merge branch 'master' into feat/remote-signer-byoc
eliteprox 97debb0
Merge branch 'master' into feat/remote-signer-byoc
cursoragent 8826686
fix(byoc): reject timeout_seconds values that exceed uint32 wire limit
cursoragent a00d26b
Merge branch 'master' into feat/remote-signer-byoc
eliteprox File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,26 @@ | ||
| package byoc | ||
|
|
||
| import ( | ||
| "testing" | ||
|
|
||
| "github.com/stretchr/testify/require" | ||
| ) | ||
|
|
||
| func TestValidateBYOCJobTimeoutSeconds(t *testing.T) { | ||
| require := require.New(t) | ||
|
|
||
| require.NoError(ValidateBYOCJobTimeoutSeconds(1)) | ||
| require.NoError(ValidateBYOCJobTimeoutSeconds(MaxBYOCJobTimeoutSeconds)) | ||
|
|
||
| err := ValidateBYOCJobTimeoutSeconds(0) | ||
| require.Error(err) | ||
| require.Contains(err.Error(), "positive") | ||
|
|
||
| err = ValidateBYOCJobTimeoutSeconds(-1) | ||
| require.Error(err) | ||
| require.Contains(err.Error(), "positive") | ||
|
|
||
| err = ValidateBYOCJobTimeoutSeconds(MaxBYOCJobTimeoutSeconds + 1) | ||
| require.Error(err) | ||
| require.Contains(err.Error(), "maximum") | ||
| } |
This file contains hidden or 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 hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: livepeer/go-livepeer
Length of output: 13322
🏁 Script executed:
Repository: livepeer/go-livepeer
Length of output: 5959
🏁 Script executed:
Repository: livepeer/go-livepeer
Length of output: 4161
Reject non-positive timeouts before flattening. The BYOC request validators only guard
Timeout == 0, so negative values can reach this encoder and wrap throughuint32(job.TimeoutSeconds).<= 0is the safer check.🧰 Tools
🪛 ast-grep (0.44.1)
[warning] 321-321: Narrowing a non-constant integer to a smaller fixed-width type (int8/int16/int32, uint8/uint16/uint32) can silently overflow or wrap, yielding negative or truncated values that are dangerous in size, length, or index logic. Validate the source value is within the target type's range before converting (e.g. bounds-check, or use a checked helper), and avoid narrowing untrusted or len()/parsed values.
Context: uint32(job.TimeoutSeconds)
Note: [CWE-190] Integer Overflow or Wraparound.
(integer-overflow-narrowing-conversion-go)
[warning] 324-324: Narrowing a non-constant integer to a smaller fixed-width type (int8/int16/int32, uint8/uint16/uint32) can silently overflow or wrap, yielding negative or truncated values that are dangerous in size, length, or index logic. Validate the source value is within the target type's range before converting (e.g. bounds-check, or use a checked helper), and avoid narrowing untrusted or len()/parsed values.
Context: uint32(len(idBytes))
Note: [CWE-190] Integer Overflow or Wraparound.
(integer-overflow-narrowing-conversion-go)
[warning] 329-329: Narrowing a non-constant integer to a smaller fixed-width type (int8/int16/int32, uint8/uint16/uint32) can silently overflow or wrap, yielding negative or truncated values that are dangerous in size, length, or index logic. Validate the source value is within the target type's range before converting (e.g. bounds-check, or use a checked helper), and avoid narrowing untrusted or len()/parsed values.
Context: uint32(len(capBytes))
Note: [CWE-190] Integer Overflow or Wraparound.
(integer-overflow-narrowing-conversion-go)
[warning] 334-334: Narrowing a non-constant integer to a smaller fixed-width type (int8/int16/int32, uint8/uint16/uint32) can silently overflow or wrap, yielding negative or truncated values that are dangerous in size, length, or index logic. Validate the source value is within the target type's range before converting (e.g. bounds-check, or use a checked helper), and avoid narrowing untrusted or len()/parsed values.
Context: uint32(len(reqBytes))
Note: [CWE-190] Integer Overflow or Wraparound.
(integer-overflow-narrowing-conversion-go)
[warning] 339-339: Narrowing a non-constant integer to a smaller fixed-width type (int8/int16/int32, uint8/uint16/uint32) can silently overflow or wrap, yielding negative or truncated values that are dangerous in size, length, or index logic. Validate the source value is within the target type's range before converting (e.g. bounds-check, or use a checked helper), and avoid narrowing untrusted or len()/parsed values.
Context: uint32(len(paramsBytes))
Note: [CWE-190] Integer Overflow or Wraparound.
(integer-overflow-narrowing-conversion-go)
🤖 Prompt for AI Agents
Source: Linters/SAST tools