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

Configure Flatmanager to support authenticators #308

Open
danirabbit opened this issue Jan 25, 2022 · 0 comments
Open

Configure Flatmanager to support authenticators #308

danirabbit opened this issue Jan 25, 2022 · 0 comments

Comments

@danirabbit
Copy link
Member

danirabbit commented Jan 25, 2022

According to https://github.com/flatpak/flatpak/wiki/TestingPurchases, we need to specify that the things we build into the repo require a token

add this line to the example repo config here:

 "require-auth-for-token-types": [2],
 This will make flat-manager require a token matching the ref for all commits with token-type 2.

Now, build something we want to test, I'm using eye of gnome as an example here:

$ flatpak-builder --repo build-repo builddir org.gnome.eog.yml

Then import and publish the build into flat-manager with a token type of 2:

$ export REPO_TOKEN=$(echo -n "secret" | base64 | cargo run --bin gentoken -- --base64 --secret-file - --name test)
$ flat-manager-client push --publish --wait-update --token-type=2 $(flat-manager-client create http://127.0.0.1:8080 stable) build-repo

We can verify that this commit gets a 403 error: (replace with your commit ids)

$ cat repo/refs/heads/app/org.gnome.eog/x86_64/master 32820032f58cb1229edffdc66dc829b29a8cce9f8b6d9f36342d76a004b61d01
$ curl http://127.0.0.1:8080/repo/stable/objects/32/820032f58cb1229edffdc66dc829b29a8cce9f8b6d9f36342d76a004b61d01.commit
{"error-type":"token-insufficient","message":"Not enough permissions: No token specified","status":403}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests

1 participant