Use artifacts v4 jwt if available #471

Merged
lunny merged 2 commits from ChristopherHX/act_runner:jwt-runtime-token into main 2024-02-08 02:43:40 +00:00
Contributor

Needs https://github.com/go-gitea/gitea/pull/28885 to provide jwt if sent by server

Could fix #459, but that has not been verified.

Needs https://github.com/go-gitea/gitea/pull/28885 to provide jwt if sent by server Could fix #459, but that has not been verified.
ChristopherHX added 1 commit 2024-01-21 20:25:11 +00:00
Use artifacts v4 jwt if available
All checks were successful
checks / check and test (pull_request) Successful in 1m49s
b56fedff6e
Author
Contributor

Need to look into masking the new secret Should be masked now in this PR.

~~Need to look into masking the new secret~~ Should be masked now in this PR.
ChristopherHX force-pushed jwt-runtime-token from b56fedff6e to 58a3ef40e8 2024-01-21 20:55:04 +00:00 Compare
lunny added the
kind
enhancement
label 2024-01-22 01:43:57 +00:00
delvh approved these changes 2024-01-29 00:07:10 +00:00
delvh left a comment
Owner

Which of the PRs must be merged first?
Or is the order irrelevant?

Which of the PRs must be merged first? Or is the order irrelevant?
Owner

How are runners on old instances handled?
To me as a relative outsider, it looks like the map would return null in this case, thus letting the runner panic as null has no GetStringValue().

How are runners on old instances handled? To me as a relative outsider, it looks like the map would return `null` in this case, thus letting the runner panic as `null` has no `GetStringValue()`.
Author
Contributor

Yes the order is irrelevant.

How are runners on old instances handled?

Old Gitea Instances are handled by using the old token for artifacts v3

Old runners are handled like this
act_runner just drops the jwt field if it is older.
Also the old token will continue to work with artifacts v3

To me as a relative outsider, it looks like the map would return null in this case

Yes this is true

thus letting the runner panic as null has no GetStringValue().

No panic, just an empty string

The last time I looked into this GetStringValue isn't virtual (interface method are virtual) and don't do any lookup based on the this object.

GetStringValue call GetKind and handles the conversion error

3068604084/types/known/structpb/struct.pb.go (L495)

GetKind handles the nil case

3068604084/types/known/structpb/struct.pb.go (L474)

BTW in go is a typed nil of a struct not the same as a nil of type interface{} / other interfaces

Yes the order is irrelevant. > How are runners on old instances handled? Old Gitea Instances are handled by using the old token for artifacts v3 Old runners are handled like this act_runner just drops the jwt field if it is older. Also the old token will continue to work with artifacts v3 > To me as a relative outsider, it looks like the map would return null in this case Yes this is true > thus letting the runner panic as null has no GetStringValue(). No panic, just an empty string The last time I looked into this `GetStringValue` isn't virtual (interface method are virtual) and don't do any lookup based on the this object. GetStringValue call GetKind and handles the conversion error https://github.com/protocolbuffers/protobuf-go/blob/3068604084670a0d5cc410b3489db359c30afd33/types/known/structpb/struct.pb.go#L495 GetKind handles the nil case https://github.com/protocolbuffers/protobuf-go/blob/3068604084670a0d5cc410b3489db359c30afd33/types/known/structpb/struct.pb.go#L474 BTW in go is a typed nil of a struct not the same as a nil of type interface{} / other interfaces
lunny approved these changes 2024-02-05 10:48:05 +00:00
lunny added 1 commit 2024-02-05 10:48:17 +00:00
Merge branch 'main' into jwt-runtime-token
All checks were successful
checks / check and test (pull_request) Successful in 1m13s
f58c129c49
lunny merged commit e6630e2e36 into main 2024-02-08 02:43:40 +00:00
Sign in to join this conversation.
No description provided.