Skip to content

Commit db2fe0e

Browse files
committed
Deprecate standalone gentoken binary
1 parent aa2700f commit db2fe0e

12 files changed

Lines changed: 14 additions & 53 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ default-run = "flat-manager"
77
edition = "2021"
88

99
[workspace]
10-
members = ["common", "client", "gentoken"]
11-
default-members = [".", "common", "client", "gentoken"]
10+
members = ["common", "client"]
11+
default-members = [".", "common", "client"]
1212

1313
[lib]
1414
name = "flatmanager"

Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ RUN chmod +x /usr/local/bin/catatonit
2222

2323
COPY --from=builder /src/target/release/flat-manager /usr/local/bin/flat-manager
2424
COPY --from=builder /flat-manager-hooks/target/release/flathub-hooks /usr/local/bin/flathub-hooks
25-
COPY --from=builder /src/target/release/gentoken /usr/local/bin/gentoken
2625
COPY --from=builder /src/target/release/flat-manager-client /usr/local/bin/flat-manager-client
2726

2827
ENV RUST_BACKTRACE=1

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ your token for sharing with others (for example sending the above
142142
upload-only token to a builder), but you can also generate a
143143
token with the gentoken command:
144144

145-
echo -n "secret" | base64 | cargo run --bin gentoken -- --base64 --secret-file - --name testtoken
145+
echo -n "secret" | base64 | cargo run --bin flat-manager-client -- gentoken --base64 --secret-file - --name testtoken
146146

147147
The above matches the default secret, so can be used for testing.
148148

@@ -157,7 +157,7 @@ For a production setup, you will also want to generate a token
157157
for `delta-generator`. This can be done by following the above
158158
command with these arguments:
159159

160-
echo -n "secret" | base64 | cargo run --bin gentoken -- --base64 --secret-file - --name delta-generator --sub delta --scope generate
160+
echo -n "secret" | base64 | cargo run --bin flat-manager-client -- gentoken --base64 --secret-file - --name delta-generator --sub delta --scope generate
161161

162162
## Running
163163

@@ -180,7 +180,7 @@ the repository, but for testing we can just do it in a subdirectory:
180180

181181
Then we can upload it to the repository by doing (assuming the default secret):
182182

183-
export REPO_TOKEN=$(echo -n "secret" | base64 | cargo run --bin gentoken -- --base64 --secret-file - --name test)
183+
export REPO_TOKEN=$(echo -n "secret" | base64 | cargo run --bin flat-manager-client -- gentoken --base64 --secret-file - --name test)
184184
./flat-manager-client push --commit $(./flat-manager-client create http://127.0.0.1:8080 stable) test-build/local-repo
185185

186186
This will create a new "build", upload the build to it and then "commit" the build.

client/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,4 @@ serde_derive = "1.0"
2020
serde_json = "1.0"
2121
thiserror = "2"
2222
tokio = { version = "1.18", features = ["time", "macros", "rt", "rt-multi-thread"] }
23+
jwt = { version = "10.3.0", package = "jsonwebtoken", features = ["aws_lc_rs"] }
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use jwt::{encode, EncodingKey, Header};
44
use std::fs;
55
use std::io::{self, Read};
66

7-
use crate::tokens::{Claims, ClaimsScope};
7+
use flat_manager_common::tokens::{Claims, ClaimsScope};
88

99
fn default_duration() -> i64 {
1010
Duration::days(365).num_seconds()

client/src/main.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ use base64::{engine::general_purpose::URL_SAFE_NO_PAD, Engine};
44
use chrono::DateTime;
55
use clap::{Args, Parser, Subcommand};
66
use client::{ApiClient, ClientError, JobPoller};
7-
use flat_manager_common::gentoken::{run_gentoken, GentokenArgs};
7+
mod gentoken;
8+
9+
use gentoken::{run_gentoken, GentokenArgs};
810
use log::LevelFilter;
911
use serde::Deserialize;
1012
use serde_json::{json, Value};

common/Cargo.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,7 @@ license = "MIT OR Apache-2.0"
66

77
[dependencies]
88
base64 = "0.22"
9-
chrono = { version = "0.4", features = ["serde"] }
10-
clap = { version = "4.5.60", features = ["derive"] }
119
hex = "0.4"
12-
jwt = { package = "jsonwebtoken", version = "10.3.0", features = ["aws_lc_rs"] }
1310
libostree = { package = "ostree", version = "0.20.5", features = ["v2021_5"] }
1411
serde = "1.0"
1512
serde_derive = "1.0"

common/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
pub mod gentoken;
21
pub mod ostree;
32
pub mod tokens;

gentoken/Cargo.toml

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)