-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
OIDC provider #25664
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
base: main
Are you sure you want to change the base?
OIDC provider #25664
Conversation
Still work-in-progress. I have a few more things I want to test before it's ready. |
go.mod
Outdated
@@ -300,7 +300,7 @@ replace github.com/hashicorp/go-version => github.com/6543/go-version v1.3.1 | |||
|
|||
replace github.com/shurcooL/vfsgen => github.com/lunny/vfsgen v0.0.0-20220105142115-2c99e1ffdfa0 | |||
|
|||
replace github.com/nektos/act => gitea.com/gitea/act v0.243.4 | |||
replace github.com/nektos/act => gitea.com/sorenisanerd/act v0.246.1-0.20230704003127-0ffa64475fd8 |
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.
Please send PR to gitea.com/gitea/act first.
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.
I think this is ready for review, but obviously it's useless without the act and act_runner changes. |
@sorenisanerd Thank you for your work, I have to say you did a great job, good idea, good code. However, this featrue has been blocked some trivial things.
You know, once permissions are involved, we need to be checked more carefully. Please give us some time to discuss and decide. |
Thank you for your kind comments :) I'm very open to porting this to gitea or actionlinter or wherever. I don't have any strong opinions on it. I agree it would have made more sense to first use permissions to adjust the capabilities of the GitHub token. I happened to need this oidc-provider functionality, so that's what I focused on. I included methods for merging permissions as well as definitions matching GitHub's defaults so I or someone else could add that later. Great point about how permissions are affected when permissions apply for pull requests. Is that supposed to be safeguarded by the need to approve workflow runs for new contributors? I honestly don't know what GitHub does. |
800f861
to
04d2045
Compare
I've pushed changes to the act and act_runner PR's on gitea.com. The resulting diffs are very modest. The rest of the functionality has been pulled into Gitea here. Is this approach more agreeable? I'll add some tests once we're happy with the overall approach. |
04d2045
to
0f08ddd
Compare
2f188c2
to
ded82c3
Compare
I rebased this and reworked it into a set of more reviewable commits. If you like, I can submit them as individual PR's, but each one depends on the previous ones, which makes it a little awkward to manage as separate PR's. |
This depends on a few changes in act and act_runner: https://gitea.com/gitea/act_runner/pulls/272 https://gitea.com/gitea/act/pulls/73
6f5666e
to
724e138
Compare
Nothing new, just rebased and folded ded82c3 (the formatting changes based on the linting errors) into the relevant patches. |
@@ -303,7 +303,7 @@ replace github.com/hashicorp/go-version => github.com/6543/go-version v1.3.1 | |||
|
|||
replace github.com/shurcooL/vfsgen => github.com/lunny/vfsgen v0.0.0-20220105142115-2c99e1ffdfa0 | |||
|
|||
replace github.com/nektos/act => gitea.com/gitea/act v0.243.4 | |||
replace github.com/nektos/act => gitea.com/sorenisanerd/act v0.246.2-0.20230806181409-a9e947b70bf6 |
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.
Maybe a update on gitea/act side is better.
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.
As mentioned in the PR description, there's a PR against gitea/act at https://gitea.com/gitea/act/pulls/73 since several months ago.
models/migrations/v1_21/v276.go
Outdated
|
||
func AddPermissions(x *xorm.Engine) error { | ||
type ActionRunJob struct { | ||
Permissions actions_model.Permissions `xorm:"JSON TEXT"` |
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.
We need to copy the Permissions struct here because in future that struct maybe changed.
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.
Excellent point. I'll make that change.
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.
Wait, does it even matter, since it's stored as JSON? Should I just put interface{}
instead of actions_model.Permissions
?
@@ -103,6 +103,7 @@ func (o *OAuth2) userIDFromToken(ctx context.Context, tokenSHA string, store Dat | |||
|
|||
store.GetData()["IsActionsToken"] = true | |||
store.GetData()["ActionsTaskID"] = task.ID | |||
store.GetData()["ActionsTask"] = task |
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.
We can load the task from database when we need it but not store it in context?
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.
I honestly don't remember why I did it this way. It's been a while. Let me take another look.
Referencing it could cause inconsistencies if it changes later.
I took the liberty of renaming my migration to just |
I'm also working on a more complete permissions implementation that should probably be merged before this one, so I'm setting this one back to WIP. I expect the permissions patch to be ready some time this week. |
Hello, are there any updates on this? is there something a contributor can help out with? Would love to see this move along |
I am also very interested om seeing this moving along. Any updates on this? |
Also chiming in support of this - it would be great for Gitea Actions to be able to authenticate to Vault via JWT. |
It was taking too much effort to merge/rebase it while it was waiting for
review, so I lost my motivation. I can't make promises about when I'll
revive it. If someone else wants to take it over, be my guest.
…On Mon, Mar 17, 2025 at 9:05 PM Jack Jackson ***@***.***> wrote:
Also chiming in support of this - it would be great for Gitea Actions to
be able to authenticate to Vault via JWT.
—
Reply to this email directly, view it on GitHub
<#25664 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABHCWU2YHQVOXC7UHOW3C32U6LQHAVCNFSM6AAAAABRF6YIUOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOMZRGU2TQNRVG4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
[image: scubbo]*scubbo* left a comment (go-gitea/gitea#25664)
<#25664 (comment)>
Also chiming in support of this - it would be great for Gitea Actions to
be able to authenticate to Vault via JWT.
—
Reply to this email directly, view it on GitHub
<#25664 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABHCWU2YHQVOXC7UHOW3C32U6LQHAVCNFSM6AAAAABRF6YIUOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOMZRGU2TQNRVG4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Understandable - thank you for your effort so far! I haven't made any contributions to the EDIT: Here's hoping that this will get more traction! I will of course give you full credit if this gets merged. Thanks again, @sorenisanerd! |
Resurrecting [this PR](https://gitea.com/gitea/act/pulls/73) as the original author has [lost motivation](go-gitea/gitea#25664 (comment)) (though, to be clear - all credit belongs to them, all mistakes are mine and mine alone!) Co-authored-by: Søren L. Hansen <[email protected]> Reviewed-on: https://gitea.com/gitea/act/pulls/133 Reviewed-by: Lunny Xiao <[email protected]> Co-authored-by: Jack Jackson <[email protected]> Co-committed-by: Jack Jackson <[email protected]>
This adds support for a Github Actions compatible OIDC provider.
For more info, see:
https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect
It depends on a few changes in act and act_runner:
https://gitea.com/gitea/act_runner/pulls/272
https://gitea.com/gitea/act/pulls/73