@whitequark yeah, Teahouse follows the trusted publishers model
Which is more flexible (since like half of known CI/CD have an OIDC story now), but there is a bundle of integration work
@whitequark yeah, Teahouse follows the trusted publishers model
Which is more flexible (since like half of known CI/CD have an OIDC story now), but there is a bundle of integration work
@astraluma I'm not opposed to having OIDC support (assuming it's not too much of an ongoing maintenance burden), but using Forgejo tokens is so much easier
@whitequark it helps that we started on GitHub and have been trying to move outward from there.
@astraluma so how do you verify an OIDC token, anyway? it's some JWT thing that the forge gives you, right? do you need the forge's public key?
@whitequark infodump engaged!
Ok, so yeah, you're at the right starting point. An OIDC token is a JWT. But there's some schemes defined on top of that.
JWT have "claims", a combination of metadata and restrictions. One of the standard ones is `iss`--the issuer URL.
OIDC says that you can find configuration data at `{iss}/.well-known/openid-configuration`, which includes two things I use: What algorithms are allowed, and where the JWKs (JSON Web Keys) are published.
@whitequark (This is also frequently `/.well-known/jwks`).
So, if you trust DNS and TLS and PKI, you have all the public keys that issuer users. Apply some crypto, and you can validate that the original token is self-consistent and is from who it says it's frame.
From there, it's a "simple" matter of reading a bunch of docs, figuring out what issuers are used by various services, and how to pull pertinent idenity info from the rest of the JWT.
@astraluma right! thanks. I've also reviewed Forgejo and Tailscale's docs for this
it does seem viable to add support for OIDC without that much effort, but offline (cryptographic) validation adds a lot of things that can go wrong, compared to online validation. this makes me uneasy
@whitequark yeah, unfortunately I haven't had the time to write all the client tools and test repos needed to properly validate it across the ~6~5 vendors we support.
@astraluma which language?
@whitequark Teahouse is primarily a Python shop
@astraluma right. might still use that as a template though
@whitequark Also, have vendor docs links:
https://support.atlassian.com/bitbucket-cloud/docs/integrate-pipelines-with-resource-servers-using-oidc/
https://circleci.com/docs/guides/permissions-authentication/openid-connect-tokens/
https://forgejo.org/docs/next/user/actions/security-openid-connect/
https://docs.github.com/en/actions/concepts/security/openid-connect
https://docs.gitlab.com/ci/secrets/id_token_authentication/
@astraluma wow that's. that's painful
@whitequark i have a block of code dedicated to triple checking validated tokens before pulling out & massaging vendor-specific data.
@astraluma so i understand the basics of validating these tokens, but the big question is: how do i map "the set of provider-specific claims that should be allowed to publish" to DNS?
i guess it would be
_git-pages-oidc-allowlist TXT "forgejo username/reponame"
or... something, but there is so much space to utterly fuck this up
also i'm guessing "username/reponame" is too simplistic and in a real implementation it would be a base64'd json which contains some sort of match expression
then a webpage that lets you construct these things
what a migraine
@astraluma i do not want to be responsible for this, i think
@whitequark I think in most situations, the tools are allowed to specify the `aud` (audience) claim: who is supposed to be receiving the token.
Teahouse's admin panel normalizes repos to <forge domain>/<repo path>. It would be reasonable (and not too difficult) to extend that to allow a trailing /*
@astraluma right, in which case the existing
_git-pages-forge-allowlist TXT "https://forge.tld/user/repo.git"
format could be used still