Add support for GitHub OIDC auth for mod uploads

A place to talk about the official Factorio mod portal (https://mods.factorio.com)
bNarFProfCrazy
Fast Inserter
Fast Inserter
Posts: 195
Joined: Sat Apr 23, 2016 7:11 am
Contact:

Add support for GitHub OIDC auth for mod uploads

Post by bNarFProfCrazy »

Currently, you have to use an API Key to upload a new version of a mod.

It would be nice (and more secure) to use GitHub OIDC based auth for mod uploads.

You could implement this as an additional flag in the mod page. After configuring the source repo in the mod page and enabling the flag in the mod/user settings, you can use its source repo to directly publish new versions of that mod.

Pros:
- No API key to be leaked

Cons:
- Currently does not handle initial mod upload (though, if you add a GH username to the profile page, then you could use that to associate a new mod with a factorio account)

Code: Select all

OIDC_TOKEN="$(
  curl -sS \
    -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" \
    "${ACTIONS_ID_TOKEN_REQUEST_URL}&audience=https://mods.factorio.com/mod/<my-Mod>" \
  | jq -r '.value'
)"

curl -X POST "mod upload url" \
  -H "Authorization: Bearer $OIDC_TOKEN" \
  -F "file=@./mod.zip"
Post Reply

Return to “Mod portal Discussion”