From 22fd0b86f310061718e132084d12739b045b403f Mon Sep 17 00:00:00 2001 From: guillaume Date: Thu, 5 Sep 2024 15:04:15 -0400 Subject: [PATCH] chore: change name to notary Signed-off-by: guillaume --- .../{build-gocert.yaml => build-notary.yaml} | 2 +- .github/workflows/build-rock.yaml | 30 +++++------ .github/workflows/main.yml | 10 ++-- .../{test-gocert.yaml => test-notary.yaml} | 2 +- CONTRIBUTING.md | 6 +-- README.md | 50 +++++++++---------- cmd/{gocert => notary}/main.go | 4 +- cmd/{gocert => notary}/main_test.go | 6 +-- go.mod | 2 +- internal/api/handlers.go | 20 ++++---- internal/api/handlers_test.go | 16 +++--- internal/api/middleware.go | 10 ++-- internal/api/server.go | 6 +-- internal/api/server_test.go | 2 +- internal/certdb/certdb_test.go | 2 +- internal/certdb/validation_test.go | 2 +- internal/config/config_test.go | 2 +- internal/metrics/metrics.go | 2 +- internal/metrics/metrics_test.go | 4 +- rockcraft.yaml | 8 +-- ui/package-lock.json | 4 +- ui/package.json | 2 +- ui/src/app/initialize/page.tsx | 2 +- ui/src/app/layout.tsx | 2 +- ui/src/app/nav.tsx | 2 +- 25 files changed, 99 insertions(+), 99 deletions(-) rename .github/workflows/{build-gocert.yaml => build-notary.yaml} (95%) rename .github/workflows/{test-gocert.yaml => test-notary.yaml} (94%) rename cmd/{gocert => notary}/main.go (88%) rename cmd/{gocert => notary}/main_test.go (98%) diff --git a/.github/workflows/build-gocert.yaml b/.github/workflows/build-notary.yaml similarity index 95% rename from .github/workflows/build-gocert.yaml rename to .github/workflows/build-notary.yaml index 8c0e52b..f8e3a14 100644 --- a/.github/workflows/build-gocert.yaml +++ b/.github/workflows/build-notary.yaml @@ -1,4 +1,4 @@ -name: Build GoCert +name: Build Notary on: workflow_call: diff --git a/.github/workflows/build-rock.yaml b/.github/workflows/build-rock.yaml index 12da33c..8ae9034 100644 --- a/.github/workflows/build-rock.yaml +++ b/.github/workflows/build-rock.yaml @@ -16,28 +16,28 @@ jobs: - name: Import the image to Docker registry run: | - sudo rockcraft.skopeo --insecure-policy copy oci-archive:${{ steps.rockcraft.outputs.rock }} docker-daemon:gocert:latest + sudo rockcraft.skopeo --insecure-policy copy oci-archive:${{ steps.rockcraft.outputs.rock }} docker-daemon:notary:latest - - name: Create files required by GoCert + - name: Create files required by Notary run: | - printf 'key_path: "/etc/gocert/config/key.pem"\ncert_path: "/etc/gocert/config/cert.pem"\ndb_path: "/var/lib/gocert/database/certs.db"\nport: 3000\npebble_notifications: true\n' > config.yaml + printf 'key_path: "/etc/notary/config/key.pem"\ncert_path: "/etc/notary/config/cert.pem"\ndb_path: "/var/lib/notary/database/certs.db"\nport: 3000\npebble_notifications: true\n' > config.yaml openssl req -newkey rsa:2048 -nodes -keyout key.pem -x509 -days 1 -out cert.pem -subj "/CN=githubaction.example" - name: Run the image run: | - docker run -d -p 3000:3000 --name gocert gocert:latest + docker run -d -p 3000:3000 --name notary notary:latest - name: Load config run: | - docker exec gocert /usr/bin/pebble mkdir -p /etc/gocert/config - docker exec gocert /usr/bin/pebble mkdir -p /var/lib/gocert/database - docker cp key.pem gocert:/etc/gocert/config/key.pem - docker cp cert.pem gocert:/etc/gocert/config/cert.pem - docker cp config.yaml gocert:/etc/gocert/config/config.yaml - docker restart gocert - - name: Check if GoCert frontend is loaded + docker exec notary /usr/bin/pebble mkdir -p /etc/notary/config + docker exec notary /usr/bin/pebble mkdir -p /var/lib/notary/database + docker cp key.pem notary:/etc/notary/config/key.pem + docker cp cert.pem notary:/etc/notary/config/cert.pem + docker cp config.yaml notary:/etc/notary/config/config.yaml + docker restart notary + - name: Check if Notary frontend is loaded run: | sleep 30 - docker logs gocert + docker logs notary curl -k https://localhost:3000/certificate_requests.html 2>&1 | grep "Certificate Requests" - name: Test if pebble notify fires correctly @@ -121,9 +121,9 @@ jobs: jdzVA8yTI8cZ/RtRohp5H/s+j2tcdfB3Zt+wfS4nLxqN/kf7qv2VSdPbXyTyz/ft btZkbfdL5A== -----END CERTIFICATE-----' -H "Authorization: Bearer $ADMIN_TOKEN" 'https://localhost:3000/api/v1/certificate_requests/1/certificate' - docker exec gocert /usr/bin/pebble notices - docker exec gocert /usr/bin/pebble notices | grep gocert\\.com/certificate/update - docker exec gocert /usr/bin/pebble notice 3 + docker exec notary /usr/bin/pebble notices + docker exec notary /usr/bin/pebble notices | grep notary\\.com/certificate/update + docker exec notary /usr/bin/pebble notice 3 - uses: actions/upload-artifact@v4 if: steps.test_notify.outcome == 'success' diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e7bb691..46d899f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,20 +13,20 @@ jobs: uses: ./.github/workflows/test-frontend.yaml build-nextjs: uses: ./.github/workflows/build-frontend.yaml - unit-test-gocert: + unit-test-notary: needs: [build-nextjs] - uses: ./.github/workflows/test-gocert.yaml + uses: ./.github/workflows/test-notary.yaml go-vet: needs: [build-nextjs] uses: ./.github/workflows/go-vet.yaml go-lint: needs: [build-nextjs] uses: ./.github/workflows/go-lint.yaml - build-gocert: + build-notary: needs: [build-nextjs] - uses: ./.github/workflows/build-gocert.yaml + uses: ./.github/workflows/build-notary.yaml rock-build: - needs: [build-gocert, unit-test-gocert, go-vet, go-lint] + needs: [build-notary, unit-test-notary, go-vet, go-lint] uses: ./.github/workflows/build-rock.yaml rock-scan: if: github.ref_name == 'main' diff --git a/.github/workflows/test-gocert.yaml b/.github/workflows/test-notary.yaml similarity index 94% rename from .github/workflows/test-gocert.yaml rename to .github/workflows/test-notary.yaml index 8d5bbda..eaa693f 100644 --- a/.github/workflows/test-gocert.yaml +++ b/.github/workflows/test-notary.yaml @@ -1,4 +1,4 @@ -name: Unit Test GoCert +name: Unit Test Notary on: workflow_call: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 28e3350..38d72ec 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -9,7 +9,7 @@ You can build and run the program by following these steps: 4. Build the frontend: `npm i --prefix ui && npm run build --prefix ui` 5. Install the project: `go install ./...` 6. Create a `config.yaml` file as described in README.md -7. Run the project: `gocert -config config.yaml` +7. Run the project: `notary -config config.yaml` Commands assume you're running them from the top level git repo directory @@ -46,6 +46,6 @@ You can create the container and import it into docker by running: ```bash rockcraft pack -v version=$(yq '.version' rockcraft.yaml) -sudo rockcraft.skopeo --insecure-policy copy oci-archive:gocert_${version}_amd64.rock docker-daemon:gocert:${version} -docker run gocert:${version} +sudo rockcraft.skopeo --insecure-policy copy oci-archive:notary_${version}_amd64.rock docker-daemon:notary:${version} +docker run notary:${version} ``` \ No newline at end of file diff --git a/README.md b/README.md index de53e49..cb27b78 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ -# gocert +# notary -GoCert is a certificate management tool. +Notary is a certificate management tool. ## Requirements -GoCert requires 3 files to operate: +Notary requires 3 files to operate: * A private key * A TLS certificate with that private key * A YAML config file with the required parameters @@ -14,24 +14,24 @@ You can generate the cert and the associated key by running: openssl req -newkey rsa:2048 -nodes -keyout key.pem -x509 -days 1 -out cert.pem -subj "/CN=example.com" ``` -GoCert does not support insecure http connections. +Notary does not support insecure http connections. ### Config File The config file requires the following parameters: -| Key | Type | Description | -|----------------------|---------|----------| -| key_path | string | path to the private key for enabling HTTPS connections | -| cert_path | string | path to a PEM formatted certificate for enabling HTTPS connections | -| db_path | string | path to a sqlite database file. If the file does not exist GoCert will attempt to create it. | -| port | integer (0-65535) | port number on which GoCert will listen for all incoming API and frontend connections. | -| pebble_notifications | boolean | Allow GoCert to send pebble notices on certificate events (create, update, delete). Pebble needs to be running on the same system as GoCert. Read more about Pebble Notices [here](https://github.com/canonical/pebble?tab=readme-ov-file#notices). | +| Key | Type | Description | +| -------------------- | ----------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| key_path | string | path to the private key for enabling HTTPS connections | +| cert_path | string | path to a PEM formatted certificate for enabling HTTPS connections | +| db_path | string | path to a sqlite database file. If the file does not exist Notary will attempt to create it. | +| port | integer (0-65535) | port number on which Notary will listen for all incoming API and frontend connections. | +| pebble_notifications | boolean | Allow Notary to send pebble notices on certificate events (create, update, delete). Pebble needs to be running on the same system as Notary. Read more about Pebble Notices [here](https://github.com/canonical/pebble?tab=readme-ov-file#notices). | An example config file may look like: ```yaml -key_path: "/etc/gocert/config/key.pem" -cert_path: "/etc/gocert/config/cert.pem" -db_path: "/var/lib/gocert/database/certs.db" +key_path: "/etc/notary/config/key.pem" +cert_path: "/etc/notary/config/cert.pem" +db_path: "/var/lib/notary/database/certs.db" port: 3000 pebble_notifications: true ``` @@ -42,23 +42,23 @@ pebble_notifications: true ```bash # Pull the OCI image from github and run it in docker -docker pull ghcr.io/canonical/gocert:latest -docker run -d --name gocert -p 3000:3000 ghcr.io/canonical/gocert:latest +docker pull ghcr.io/canonical/notary:latest +docker run -d --name notary -p 3000:3000 ghcr.io/canonical/notary:latest # Push the 3 required files and restart the workload -docker exec gocert /usr/bin/pebble mkdir -p /etc/gocert/config -docker exec gocert /usr/bin/pebble mkdir -p /var/lib/gocert/database -docker cp key.pem gocert:/etc/gocert/config/key.pem -docker cp cert.pem gocert:/etc/gocert/config/cert.pem -docker cp config.yaml gocert:/etc/gocert/config/config.yaml -docker restart gocert +docker exec notary /usr/bin/pebble mkdir -p /etc/notary/config +docker exec notary /usr/bin/pebble mkdir -p /var/lib/notary/database +docker cp key.pem notary:/etc/notary/config/key.pem +docker cp cert.pem notary:/etc/notary/config/cert.pem +docker cp config.yaml notary:/etc/notary/config/config.yaml +docker restart notary ``` ### From Source -go and npm CLI tools need to be installed in order to build gocert from source. -You will need to build the frontend first, and then install gocert with Go. +go and npm CLI tools need to be installed in order to build notary from source. +You will need to build the frontend first, and then install notary with Go. ```bash npm install --prefix ui && npm run build --prefix ui && go install ./... -gocert -config ./config.yaml +notary -config ./config.yaml ``` diff --git a/cmd/gocert/main.go b/cmd/notary/main.go similarity index 88% rename from cmd/gocert/main.go rename to cmd/notary/main.go index d3ce4e6..0c6b693 100644 --- a/cmd/gocert/main.go +++ b/cmd/notary/main.go @@ -5,8 +5,8 @@ import ( "log" "os" - server "github.com/canonical/gocert/internal/api" - "github.com/canonical/gocert/internal/config" + server "github.com/canonical/notary/internal/api" + "github.com/canonical/notary/internal/config" ) func main() { diff --git a/cmd/gocert/main_test.go b/cmd/notary/main_test.go similarity index 98% rename from cmd/gocert/main_test.go rename to cmd/notary/main_test.go index e33cd4f..5da19f8 100644 --- a/cmd/gocert/main_test.go +++ b/cmd/notary/main_test.go @@ -104,7 +104,7 @@ pebble_notices: false` func TestMain(m *testing.M) { cmd := exec.Command("go", "install", "./...") if err := cmd.Run(); err != nil { - log.Fatalf("couldn't install the gocert CLI") + log.Fatalf("couldn't install the notary CLI") } testfolder, err := os.MkdirTemp("./", "configtest-") @@ -131,7 +131,7 @@ func TestMain(m *testing.M) { os.Exit(exitval) } -func TestGoCertFail(t *testing.T) { +func TestNotaryFail(t *testing.T) { oldArgs := os.Args defer func() { os.Args = oldArgs }() cases := []struct { @@ -150,7 +150,7 @@ func TestGoCertFail(t *testing.T) { t.Errorf("Failed writing config file") } flag.CommandLine = flag.NewFlagSet(tc.Name, flag.ExitOnError) - cmd := exec.Command("gocert", tc.Args...) + cmd := exec.Command("notary", tc.Args...) stdout, _ := cmd.StdoutPipe() if err := cmd.Start(); err != nil { diff --git a/go.mod b/go.mod index 641d92a..827a446 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/canonical/gocert +module github.com/canonical/notary go 1.22.1 diff --git a/internal/api/handlers.go b/internal/api/handlers.go index c20db85..403ddbe 100644 --- a/internal/api/handlers.go +++ b/internal/api/handlers.go @@ -16,17 +16,17 @@ import ( "strings" "time" - "github.com/canonical/gocert/internal/certdb" - metrics "github.com/canonical/gocert/internal/metrics" - "github.com/canonical/gocert/ui" + "github.com/canonical/notary/internal/certdb" + metrics "github.com/canonical/notary/internal/metrics" + "github.com/canonical/notary/ui" "github.com/golang-jwt/jwt" "golang.org/x/crypto/bcrypt" ) -// NewGoCertRouter takes in an environment struct, passes it along to any handlers that will need +// NewNotaryRouter takes in an environment struct, passes it along to any handlers that will need // access to it, and takes an http.Handler that will be used to handle metrics. // then builds and returns it for a server to consume -func NewGoCertRouter(env *Environment) http.Handler { +func NewNotaryRouter(env *Environment) http.Handler { apiV1Router := http.NewServeMux() apiV1Router.HandleFunc("GET /certificate_requests", GetCertificateRequests(env)) apiV1Router.HandleFunc("POST /certificate_requests", PostCertificateRequest(env)) @@ -221,7 +221,7 @@ func PostCertificate(env *Environment) http.HandlerFunc { } insertIdStr := strconv.FormatInt(insertId, 10) if env.SendPebbleNotifications { - err := SendPebbleNotification("gocert.com/certificate/update", insertIdStr) + err := SendPebbleNotification("notary.com/certificate/update", insertIdStr) if err != nil { log.Printf("pebble notify failed: %s. continuing silently.", err.Error()) } @@ -247,7 +247,7 @@ func RejectCertificate(env *Environment) http.HandlerFunc { } insertIdStr := strconv.FormatInt(insertId, 10) if env.SendPebbleNotifications { - err := SendPebbleNotification("gocert.com/certificate/update", insertIdStr) + err := SendPebbleNotification("notary.com/certificate/update", insertIdStr) if err != nil { log.Printf("pebble notify failed: %s. continuing silently.", err.Error()) } @@ -275,7 +275,7 @@ func DeleteCertificate(env *Environment) http.HandlerFunc { } insertIdStr := strconv.FormatInt(insertId, 10) if env.SendPebbleNotifications { - err := SendPebbleNotification("gocert.com/certificate/update", insertIdStr) + err := SendPebbleNotification("notary.com/certificate/update", insertIdStr) if err != nil { log.Printf("pebble notify failed: %s. continuing silently.", err.Error()) } @@ -600,7 +600,7 @@ func validatePassword(password string) bool { // Helper function to generate a JWT func generateJWT(id int, username string, jwtSecret []byte, permissions int) (string, error) { - token := jwt.NewWithClaims(jwt.SigningMethodHS256, jwtGocertClaims{ + token := jwt.NewWithClaims(jwt.SigningMethodHS256, jwtNotaryClaims{ ID: id, Username: username, Permissions: permissions, @@ -616,7 +616,7 @@ func generateJWT(id int, username string, jwtSecret []byte, permissions int) (st return tokenString, nil } -type jwtGocertClaims struct { +type jwtNotaryClaims struct { ID int `json:"id"` Username string `json:"username"` Permissions int `json:"permissions"` diff --git a/internal/api/handlers_test.go b/internal/api/handlers_test.go index d7556a2..438c503 100644 --- a/internal/api/handlers_test.go +++ b/internal/api/handlers_test.go @@ -10,8 +10,8 @@ import ( "strings" "testing" - server "github.com/canonical/gocert/internal/api" - "github.com/canonical/gocert/internal/certdb" + server "github.com/canonical/notary/internal/api" + "github.com/canonical/notary/internal/certdb" "github.com/golang-jwt/jwt" ) @@ -152,14 +152,14 @@ const ( notExistingUser = `{"username": "not_existing", "password": "user"}` ) -func TestGoCertCertificatesHandlers(t *testing.T) { +func TestNotaryCertificatesHandlers(t *testing.T) { testdb, err := certdb.NewCertificateRequestsRepository(":memory:", "CertificateRequests") if err != nil { log.Fatalf("couldn't create test sqlite db: %s", err) } env := &server.Environment{} env.DB = testdb - ts := httptest.NewTLSServer(server.NewGoCertRouter(env)) + ts := httptest.NewTLSServer(server.NewNotaryRouter(env)) defer ts.Close() client := ts.Client() @@ -409,14 +409,14 @@ func TestGoCertCertificatesHandlers(t *testing.T) { } -func TestGoCertUsersHandlers(t *testing.T) { +func TestNotaryUsersHandlers(t *testing.T) { testdb, err := certdb.NewCertificateRequestsRepository(":memory:", "CertificateRequests") if err != nil { log.Fatalf("couldn't create test sqlite db: %s", err) } env := &server.Environment{} env.DB = testdb - ts := httptest.NewTLSServer(server.NewGoCertRouter(env)) + ts := httptest.NewTLSServer(server.NewNotaryRouter(env)) defer ts.Close() client := ts.Client() @@ -580,7 +580,7 @@ func TestLogin(t *testing.T) { env := &server.Environment{} env.DB = testdb env.JWTSecret = []byte("secret") - ts := httptest.NewTLSServer(server.NewGoCertRouter(env)) + ts := httptest.NewTLSServer(server.NewNotaryRouter(env)) defer ts.Close() client := ts.Client() @@ -694,7 +694,7 @@ func TestAuthorization(t *testing.T) { env := &server.Environment{} env.DB = testdb env.JWTSecret = []byte("secret") - ts := httptest.NewTLSServer(server.NewGoCertRouter(env)) + ts := httptest.NewTLSServer(server.NewNotaryRouter(env)) defer ts.Close() client := ts.Client() diff --git a/internal/api/middleware.go b/internal/api/middleware.go index 86dbd75..f6960f6 100644 --- a/internal/api/middleware.go +++ b/internal/api/middleware.go @@ -8,7 +8,7 @@ import ( "strconv" "strings" - "github.com/canonical/gocert/internal/metrics" + "github.com/canonical/notary/internal/metrics" "github.com/golang-jwt/jwt" "github.com/prometheus/client_golang/prometheus/promhttp" ) @@ -133,7 +133,7 @@ func authMiddleware(ctx *middlewareContext) middleware { } } -func getClaimsFromAuthorizationHeader(header string, jwtSecret []byte) (*jwtGocertClaims, error) { +func getClaimsFromAuthorizationHeader(header string, jwtSecret []byte) (*jwtNotaryClaims, error) { if header == "" { return nil, fmt.Errorf("authorization header not found") } @@ -159,7 +159,7 @@ func getClaimsFromAuthorizationHeader(header string, jwtSecret []byte) (*jwtGoce // If the URL path is not restricted to admins // If the URL path is restricted to self authorized endpoints, and the user is taking action with their own ID // This function validates that the user the with the given claims is allowed to use the endpoints by passing the above checks. -func AllowRequest(claims *jwtGocertClaims, method, path string) (bool, error) { +func AllowRequest(claims *jwtNotaryClaims, method, path string) (bool, error) { restrictedPaths := []struct { method, pathRegex string SelfAuthorizedAllowed bool @@ -200,8 +200,8 @@ func AllowRequest(claims *jwtGocertClaims, method, path string) (bool, error) { return true, nil } -func getClaimsFromJWT(bearerToken string, jwtSecret []byte) (*jwtGocertClaims, error) { - claims := jwtGocertClaims{} +func getClaimsFromJWT(bearerToken string, jwtSecret []byte) (*jwtNotaryClaims, error) { + claims := jwtNotaryClaims{} token, err := jwt.ParseWithClaims(bearerToken, &claims, func(token *jwt.Token) (interface{}, error) { if _, ok := token.Method.(*jwt.SigningMethodHMAC); !ok { return nil, fmt.Errorf("unexpected signing method: %v", token.Header["alg"]) diff --git a/internal/api/server.go b/internal/api/server.go index 6fd3887..ebb1be5 100644 --- a/internal/api/server.go +++ b/internal/api/server.go @@ -1,4 +1,4 @@ -// Package server provides a server object that represents the GoCert backend +// Package server provides a server object that represents the Notary backend package server import ( @@ -11,7 +11,7 @@ import ( "os/exec" "time" - "github.com/canonical/gocert/internal/certdb" + "github.com/canonical/notary/internal/certdb" ) type Environment struct { @@ -55,7 +55,7 @@ func NewServer(port int, cert []byte, key []byte, dbPath string, pebbleNotificat env.DB = db env.SendPebbleNotifications = pebbleNotificationsEnabled env.JWTSecret = jwtSecret - router := NewGoCertRouter(env) + router := NewNotaryRouter(env) s := &http.Server{ Addr: fmt.Sprintf(":%d", port), diff --git a/internal/api/server_test.go b/internal/api/server_test.go index 535ac71..2510ab7 100644 --- a/internal/api/server_test.go +++ b/internal/api/server_test.go @@ -5,7 +5,7 @@ import ( "os" "testing" - server "github.com/canonical/gocert/internal/api" + server "github.com/canonical/notary/internal/api" ) const ( diff --git a/internal/certdb/certdb_test.go b/internal/certdb/certdb_test.go index a72f8b0..471775a 100644 --- a/internal/certdb/certdb_test.go +++ b/internal/certdb/certdb_test.go @@ -7,7 +7,7 @@ import ( "strings" "testing" - "github.com/canonical/gocert/internal/certdb" + "github.com/canonical/notary/internal/certdb" "golang.org/x/crypto/bcrypt" ) diff --git a/internal/certdb/validation_test.go b/internal/certdb/validation_test.go index 8abf1ff..cfc4be2 100644 --- a/internal/certdb/validation_test.go +++ b/internal/certdb/validation_test.go @@ -5,7 +5,7 @@ import ( "strings" "testing" - "github.com/canonical/gocert/internal/certdb" + "github.com/canonical/notary/internal/certdb" ) const ( diff --git a/internal/config/config_test.go b/internal/config/config_test.go index 0aecd23..736420d 100644 --- a/internal/config/config_test.go +++ b/internal/config/config_test.go @@ -6,7 +6,7 @@ import ( "strings" "testing" - "github.com/canonical/gocert/internal/config" + "github.com/canonical/notary/internal/config" ) const ( diff --git a/internal/metrics/metrics.go b/internal/metrics/metrics.go index c0ef923..f97cf90 100644 --- a/internal/metrics/metrics.go +++ b/internal/metrics/metrics.go @@ -8,7 +8,7 @@ import ( "net/http" "time" - "github.com/canonical/gocert/internal/certdb" + "github.com/canonical/notary/internal/certdb" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/collectors" "github.com/prometheus/client_golang/prometheus/promhttp" diff --git a/internal/metrics/metrics_test.go b/internal/metrics/metrics_test.go index a94286c..aadf39f 100644 --- a/internal/metrics/metrics_test.go +++ b/internal/metrics/metrics_test.go @@ -15,8 +15,8 @@ import ( "testing" "time" - "github.com/canonical/gocert/internal/certdb" - metrics "github.com/canonical/gocert/internal/metrics" + "github.com/canonical/notary/internal/certdb" + metrics "github.com/canonical/notary/internal/metrics" ) // TestPrometheusHandler tests that the Prometheus metrics handler responds correctly to an HTTP request. diff --git a/rockcraft.yaml b/rockcraft.yaml index 61ac6ef..f8908ef 100644 --- a/rockcraft.yaml +++ b/rockcraft.yaml @@ -1,4 +1,4 @@ -name: gocert +name: notary base: bare build-base: ubuntu@24.04 version: '0.0.3' @@ -11,13 +11,13 @@ platforms: arm64: services: - gocert: - command: gocert [ -config /etc/gocert/config/config.yaml ] + notary: + command: notary [ -config /etc/notary/config/config.yaml ] override: replace startup: enabled parts: - gocert: + notary: plugin: go source: . source-type: local diff --git a/ui/package-lock.json b/ui/package-lock.json index cdceaa3..61fb4c4 100644 --- a/ui/package-lock.json +++ b/ui/package-lock.json @@ -1,10 +1,10 @@ { - "name": "gocert", + "name": "notary", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "gocert", + "name": "notary", "dependencies": { "jwt-decode": "^4.0.0", "next": "14.2.3", diff --git a/ui/package.json b/ui/package.json index 6a54ac1..2ad4c89 100644 --- a/ui/package.json +++ b/ui/package.json @@ -1,5 +1,5 @@ { - "name": "gocert", + "name": "notary", "private": true, "type": "module", "scripts": { diff --git a/ui/src/app/initialize/page.tsx b/ui/src/app/initialize/page.tsx index c1156d3..d620b58 100644 --- a/ui/src/app/initialize/page.tsx +++ b/ui/src/app/initialize/page.tsx @@ -76,7 +76,7 @@ export default function Initialize() { }}>
-

Initialize GoCert

+

Initialize Notary

diff --git a/ui/src/app/layout.tsx b/ui/src/app/layout.tsx index 7ed023f..1c422ae 100644 --- a/ui/src/app/layout.tsx +++ b/ui/src/app/layout.tsx @@ -4,7 +4,7 @@ import Navigation from "@/app/nav"; import { AuthProvider } from "./auth/authContext"; export const metadata: Metadata = { - title: "GoCert", + title: "Notary", description: "A certificate management application", }; diff --git a/ui/src/app/nav.tsx b/ui/src/app/nav.tsx index 214a309..5851224 100644 --- a/ui/src/app/nav.tsx +++ b/ui/src/app/nav.tsx @@ -88,7 +88,7 @@ export function Logo() { className="logo-image" />
- GoCert + Notary ) }