Skip to content
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

Support changing the endpoint of Octo STS for Self hosting #26

Open
suzuki-shunsuke opened this issue May 6, 2024 · 3 comments · May be fixed by #27
Open

Support changing the endpoint of Octo STS for Self hosting #26

suzuki-shunsuke opened this issue May 6, 2024 · 3 comments · May be fixed by #27

Comments

@suzuki-shunsuke
Copy link

suzuki-shunsuke commented May 6, 2024

Now the endpoint of Octo STS is hardcoded to https://octo-sts.dev/sts/exchange.

const res2 = await fetchWithRetry(`https://octo-sts.dev/sts/exchange?scope=${scope}&identity=${identity}`, { headers: { 'Authorization': `Bearer ${json.value}` } });

To use this action with self-hosted Octo STS, we need to change the endpoint.
So how about adding an optional input variable endpoint to change the endpoint?
The default value is https://octo-sts.dev/sts/exchange.

e.g.

- uses: octo-sts/action@main
  id: octo-sts
  with:
    scope: your-org/your-repo
    identity: foo
    endpoint: https://example.com/sts/exchange
@suzuki-shunsuke
Copy link
Author

suzuki-shunsuke commented May 6, 2024

✅ I'll send a pull request soon.

@suzuki-shunsuke suzuki-shunsuke linked a pull request May 6, 2024 that will close this issue
@tuananh
Copy link

tuananh commented May 11, 2024

I think it maybe not enough as i saw octo-sts.dev hardcoded in octo-sts in quite many places.

@suzuki-shunsuke
Copy link
Author

📝

I think it maybe not enough as i saw octo-sts.dev hardcoded in octo-sts in quite many places.

https://github.com/search?q=repo%3Aocto-sts%2Fapp%20octo-sts.dev&type=code

~/repos/src/github.com/octo-sts/app main
$ git grep octo-sts.dev 
README.md:  "https://octo-sts.dev/sts/exchange?scope=${REPO}&identity=${NAME}"
iac/gclb.tf:  name        = "octo-sts-dev"
iac/gclb.tf:  dns_name    = "octo-sts.dev."
iac/gclb.tf:  description = "DNS zone for domain: octo-sts.dev"
iac/gclb.tf:    "octo-sts.dev" = {
pkg/octosts/octosts.go:         event.SetSource("https://octo-sts.dev")
pkg/octosts/octosts.go:         ClientID: "octo-sts.dev",
pkg/prober/prober.go:           "https://octo-sts.dev",
pkg/prober/prober.go:   ts, err := idtoken.NewTokenSource(ctx, "octo-sts.dev" /* aud */)
pkg/prober/prober.go:           "https://octo-sts.dev",
pkg/prober/prober.go:           "https://octo-sts.dev",
pkg/prober/prober.go:   ts, err := idtoken.NewTokenSource(ctx, "octo-sts.dev" /* aud */)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants