From e5d53ab77b1b14c3771eb9b4d21cab5e9abbe2f2 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Sat, 13 Apr 2024 13:48:19 +0800 Subject: [PATCH] :truck: Rename package --- .github/workflows/nightly.yml | 2 +- Dockerfile | 6 +++--- go.mod | 2 +- pkg/cmd/main.go | 16 ++++++++-------- pkg/database/migrator.go | 2 +- pkg/grpc/auth.go | 4 ++-- pkg/grpc/friendships.go | 6 +++--- pkg/grpc/notify.go | 6 +++--- pkg/grpc/server.go | 2 +- pkg/meta.go | 2 +- pkg/security/challanges.go | 4 ++-- pkg/security/factors.go | 2 +- pkg/security/jwt.go | 4 ++-- pkg/security/sessions.go | 4 ++-- pkg/server/accounts_api.go | 6 +++--- pkg/server/auth_middleware.go | 4 ++-- pkg/server/avatar_api.go | 4 ++-- pkg/server/challanges_api.go | 6 +++--- pkg/server/factors_api.go | 2 +- pkg/server/friendships_api.go | 4 ++-- pkg/server/notifications_api.go | 6 +++--- pkg/server/notify_api.go | 4 ++-- pkg/server/notify_ws.go | 4 ++-- pkg/server/oauth_api.go | 12 ++++++------ pkg/server/page_api.go | 4 ++-- pkg/server/security_api.go | 4 ++-- pkg/server/startup.go | 2 +- pkg/server/userinfo..go | 4 ++-- pkg/services/accounts.go | 6 +++--- pkg/services/auth.go | 6 +++--- pkg/services/challanges.go | 4 ++-- pkg/services/cleaner.go | 2 +- pkg/services/clients.go | 4 ++-- pkg/services/connections.go | 2 +- pkg/services/events.go | 4 ++-- pkg/services/factors.go | 4 ++-- pkg/services/friendships.go | 4 ++-- pkg/services/notifications.go | 6 +++--- pkg/services/sessions.go | 4 ++-- pkg/services/tokens.go | 4 ++-- pkg/views/package.json | 2 +- pkg/views/src/stores/userinfo.ts | 4 ++-- settings.toml | 4 ++-- 43 files changed, 94 insertions(+), 94 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 0875166..5b29b8d 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -25,4 +25,4 @@ jobs: context: . file: ./Dockerfile push: true - tags: xsheep2010/identity:nightly + tags: xsheep2010/passport:nightly diff --git a/Dockerfile b/Dockerfile index ee7b7cd..2ff61cd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Building Backend -FROM golang:alpine as identity-server +FROM golang:alpine as passport-server RUN apk add nodejs npm @@ -14,8 +14,8 @@ RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -buildvcs -o /dist ./pkg/cmd/ # Runtime FROM golang:alpine -COPY --from=identity-server /dist /identity/server +COPY --from=passport-server /dist /passport/server EXPOSE 8444 -CMD ["/identity/server"] +CMD ["/passport/server"] diff --git a/go.mod b/go.mod index 4113052..0fdcb20 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module git.solsynth.dev/hydrogen/identity +module git.solsynth.dev/hydrogen/passport go 1.21.5 diff --git a/pkg/cmd/main.go b/pkg/cmd/main.go index 6cad811..d85b6f4 100644 --- a/pkg/cmd/main.go +++ b/pkg/cmd/main.go @@ -5,14 +5,14 @@ import ( "os/signal" "syscall" - "git.solsynth.dev/hydrogen/identity/pkg/external" - "git.solsynth.dev/hydrogen/identity/pkg/grpc" - "git.solsynth.dev/hydrogen/identity/pkg/server" - "git.solsynth.dev/hydrogen/identity/pkg/services" + "git.solsynth.dev/hydrogen/passport/pkg/external" + "git.solsynth.dev/hydrogen/passport/pkg/grpc" + "git.solsynth.dev/hydrogen/passport/pkg/server" + "git.solsynth.dev/hydrogen/passport/pkg/services" "github.com/robfig/cron/v3" - identity "git.solsynth.dev/hydrogen/identity/pkg" - "git.solsynth.dev/hydrogen/identity/pkg/database" + passport "git.solsynth.dev/hydrogen/passport/pkg" + "git.solsynth.dev/hydrogen/passport/pkg/database" "github.com/rs/zerolog" "github.com/rs/zerolog/log" "github.com/spf13/viper" @@ -72,13 +72,13 @@ func main() { quartz.Start() // Messages - log.Info().Msgf("Identity v%s is started...", identity.AppVersion) + log.Info().Msgf("Identity v%s is started...", passport.AppVersion) quit := make(chan os.Signal, 1) signal.Notify(quit, syscall.SIGINT, syscall.SIGTERM) <-quit - log.Info().Msgf("Identity v%s is quitting...", identity.AppVersion) + log.Info().Msgf("Identity v%s is quitting...", passport.AppVersion) quartz.Stop() diff --git a/pkg/database/migrator.go b/pkg/database/migrator.go index e031215..3631ec7 100644 --- a/pkg/database/migrator.go +++ b/pkg/database/migrator.go @@ -1,7 +1,7 @@ package database import ( - "git.solsynth.dev/hydrogen/identity/pkg/models" + "git.solsynth.dev/hydrogen/passport/pkg/models" "gorm.io/gorm" ) diff --git a/pkg/grpc/auth.go b/pkg/grpc/auth.go index a7f3a2c..87807d8 100644 --- a/pkg/grpc/auth.go +++ b/pkg/grpc/auth.go @@ -4,8 +4,8 @@ import ( "context" "fmt" - "git.solsynth.dev/hydrogen/identity/pkg/grpc/proto" - "git.solsynth.dev/hydrogen/identity/pkg/services" + "git.solsynth.dev/hydrogen/passport/pkg/grpc/proto" + "git.solsynth.dev/hydrogen/passport/pkg/services" "github.com/spf13/viper" ) diff --git a/pkg/grpc/friendships.go b/pkg/grpc/friendships.go index 5edac2e..f9275c4 100644 --- a/pkg/grpc/friendships.go +++ b/pkg/grpc/friendships.go @@ -3,9 +3,9 @@ package grpc import ( "context" "fmt" - "git.solsynth.dev/hydrogen/identity/pkg/grpc/proto" - "git.solsynth.dev/hydrogen/identity/pkg/models" - "git.solsynth.dev/hydrogen/identity/pkg/services" + "git.solsynth.dev/hydrogen/passport/pkg/grpc/proto" + "git.solsynth.dev/hydrogen/passport/pkg/models" + "git.solsynth.dev/hydrogen/passport/pkg/services" "github.com/samber/lo" ) diff --git a/pkg/grpc/notify.go b/pkg/grpc/notify.go index 28d1a7f..4fd2c8c 100644 --- a/pkg/grpc/notify.go +++ b/pkg/grpc/notify.go @@ -3,9 +3,9 @@ package grpc import ( "context" - "git.solsynth.dev/hydrogen/identity/pkg/grpc/proto" - "git.solsynth.dev/hydrogen/identity/pkg/models" - "git.solsynth.dev/hydrogen/identity/pkg/services" + "git.solsynth.dev/hydrogen/passport/pkg/grpc/proto" + "git.solsynth.dev/hydrogen/passport/pkg/models" + "git.solsynth.dev/hydrogen/passport/pkg/services" "github.com/samber/lo" ) diff --git a/pkg/grpc/server.go b/pkg/grpc/server.go index c58a46a..4764a84 100644 --- a/pkg/grpc/server.go +++ b/pkg/grpc/server.go @@ -3,7 +3,7 @@ package grpc import ( "net" - "git.solsynth.dev/hydrogen/identity/pkg/grpc/proto" + "git.solsynth.dev/hydrogen/passport/pkg/grpc/proto" "github.com/spf13/viper" "google.golang.org/grpc" "google.golang.org/grpc/reflection" diff --git a/pkg/meta.go b/pkg/meta.go index d27f78b..6780a6d 100644 --- a/pkg/meta.go +++ b/pkg/meta.go @@ -1,4 +1,4 @@ -package identity +package passport const ( AppVersion = "1.0.0" diff --git a/pkg/security/challanges.go b/pkg/security/challanges.go index 4160923..0db0200 100644 --- a/pkg/security/challanges.go +++ b/pkg/security/challanges.go @@ -7,8 +7,8 @@ import ( "github.com/google/uuid" - "git.solsynth.dev/hydrogen/identity/pkg/database" - "git.solsynth.dev/hydrogen/identity/pkg/models" + "git.solsynth.dev/hydrogen/passport/pkg/database" + "git.solsynth.dev/hydrogen/passport/pkg/models" "github.com/samber/lo" "gorm.io/datatypes" ) diff --git a/pkg/security/factors.go b/pkg/security/factors.go index 896a6c0..5d86876 100644 --- a/pkg/security/factors.go +++ b/pkg/security/factors.go @@ -3,7 +3,7 @@ package security import ( "fmt" - "git.solsynth.dev/hydrogen/identity/pkg/models" + "git.solsynth.dev/hydrogen/passport/pkg/models" "github.com/samber/lo" ) diff --git a/pkg/security/jwt.go b/pkg/security/jwt.go index 1bdd05e..8d77545 100644 --- a/pkg/security/jwt.go +++ b/pkg/security/jwt.go @@ -9,8 +9,8 @@ import ( "github.com/spf13/viper" ) -var CookieAccessKey = "identity_auth_key" -var CookieRefreshKey = "identity_refresh_key" +var CookieAccessKey = "passport_auth_key" +var CookieRefreshKey = "passport_refresh_key" type PayloadClaims struct { jwt.RegisteredClaims diff --git a/pkg/security/sessions.go b/pkg/security/sessions.go index ee01e2b..abfc4fe 100644 --- a/pkg/security/sessions.go +++ b/pkg/security/sessions.go @@ -7,8 +7,8 @@ import ( "github.com/spf13/viper" - "git.solsynth.dev/hydrogen/identity/pkg/database" - "git.solsynth.dev/hydrogen/identity/pkg/models" + "git.solsynth.dev/hydrogen/passport/pkg/database" + "git.solsynth.dev/hydrogen/passport/pkg/models" "github.com/google/uuid" "github.com/samber/lo" ) diff --git a/pkg/server/accounts_api.go b/pkg/server/accounts_api.go index 3669702..96858fa 100644 --- a/pkg/server/accounts_api.go +++ b/pkg/server/accounts_api.go @@ -5,9 +5,9 @@ import ( "strconv" "time" - "git.solsynth.dev/hydrogen/identity/pkg/database" - "git.solsynth.dev/hydrogen/identity/pkg/models" - "git.solsynth.dev/hydrogen/identity/pkg/services" + "git.solsynth.dev/hydrogen/passport/pkg/database" + "git.solsynth.dev/hydrogen/passport/pkg/models" + "git.solsynth.dev/hydrogen/passport/pkg/services" "github.com/gofiber/fiber/v2" jsoniter "github.com/json-iterator/go" "github.com/spf13/viper" diff --git a/pkg/server/auth_middleware.go b/pkg/server/auth_middleware.go index 815c7f8..284c2ce 100644 --- a/pkg/server/auth_middleware.go +++ b/pkg/server/auth_middleware.go @@ -3,8 +3,8 @@ package server import ( "strings" - "git.solsynth.dev/hydrogen/identity/pkg/security" - "git.solsynth.dev/hydrogen/identity/pkg/services" + "git.solsynth.dev/hydrogen/passport/pkg/security" + "git.solsynth.dev/hydrogen/passport/pkg/services" "github.com/gofiber/fiber/v2" ) diff --git a/pkg/server/avatar_api.go b/pkg/server/avatar_api.go index 612e765..f189aeb 100644 --- a/pkg/server/avatar_api.go +++ b/pkg/server/avatar_api.go @@ -4,8 +4,8 @@ import ( "os" "path/filepath" - "git.solsynth.dev/hydrogen/identity/pkg/database" - "git.solsynth.dev/hydrogen/identity/pkg/models" + "git.solsynth.dev/hydrogen/passport/pkg/database" + "git.solsynth.dev/hydrogen/passport/pkg/models" "github.com/gofiber/fiber/v2" "github.com/google/uuid" "github.com/spf13/viper" diff --git a/pkg/server/challanges_api.go b/pkg/server/challanges_api.go index 804b93d..826724e 100644 --- a/pkg/server/challanges_api.go +++ b/pkg/server/challanges_api.go @@ -5,8 +5,8 @@ import ( "github.com/gofiber/fiber/v2" - "git.solsynth.dev/hydrogen/identity/pkg/security" - "git.solsynth.dev/hydrogen/identity/pkg/services" + "git.solsynth.dev/hydrogen/passport/pkg/security" + "git.solsynth.dev/hydrogen/passport/pkg/services" "github.com/samber/lo" ) @@ -70,7 +70,7 @@ func doChallenge(c *fiber.Ctx) error { if err != nil { return fiber.NewError(fiber.StatusBadRequest, err.Error()) } else if challenge.Progress >= challenge.Requirements { - session, err := security.GrantSession(challenge, []string{"*"}, []string{"identity"}, nil, lo.ToPtr(time.Now())) + session, err := security.GrantSession(challenge, []string{"*"}, []string{"passport"}, nil, lo.ToPtr(time.Now())) if err != nil { return fiber.NewError(fiber.StatusBadRequest, err.Error()) } diff --git a/pkg/server/factors_api.go b/pkg/server/factors_api.go index 912cf2b..301547a 100644 --- a/pkg/server/factors_api.go +++ b/pkg/server/factors_api.go @@ -1,7 +1,7 @@ package server import ( - "git.solsynth.dev/hydrogen/identity/pkg/services" + "git.solsynth.dev/hydrogen/passport/pkg/services" "github.com/gofiber/fiber/v2" ) diff --git a/pkg/server/friendships_api.go b/pkg/server/friendships_api.go index 0831a30..75aeabc 100644 --- a/pkg/server/friendships_api.go +++ b/pkg/server/friendships_api.go @@ -1,8 +1,8 @@ package server import ( - "git.solsynth.dev/hydrogen/identity/pkg/models" - "git.solsynth.dev/hydrogen/identity/pkg/services" + "git.solsynth.dev/hydrogen/passport/pkg/models" + "git.solsynth.dev/hydrogen/passport/pkg/services" "github.com/gofiber/fiber/v2" ) diff --git a/pkg/server/notifications_api.go b/pkg/server/notifications_api.go index e897dba..1f3ff94 100644 --- a/pkg/server/notifications_api.go +++ b/pkg/server/notifications_api.go @@ -3,9 +3,9 @@ package server import ( "time" - "git.solsynth.dev/hydrogen/identity/pkg/database" - "git.solsynth.dev/hydrogen/identity/pkg/models" - "git.solsynth.dev/hydrogen/identity/pkg/services" + "git.solsynth.dev/hydrogen/passport/pkg/database" + "git.solsynth.dev/hydrogen/passport/pkg/models" + "git.solsynth.dev/hydrogen/passport/pkg/services" "github.com/gofiber/fiber/v2" "github.com/samber/lo" ) diff --git a/pkg/server/notify_api.go b/pkg/server/notify_api.go index 50650b6..a3aeb88 100644 --- a/pkg/server/notify_api.go +++ b/pkg/server/notify_api.go @@ -1,8 +1,8 @@ package server import ( - "git.solsynth.dev/hydrogen/identity/pkg/models" - "git.solsynth.dev/hydrogen/identity/pkg/services" + "git.solsynth.dev/hydrogen/passport/pkg/models" + "git.solsynth.dev/hydrogen/passport/pkg/services" "github.com/gofiber/fiber/v2" ) diff --git a/pkg/server/notify_ws.go b/pkg/server/notify_ws.go index 105f46d..d33f91f 100644 --- a/pkg/server/notify_ws.go +++ b/pkg/server/notify_ws.go @@ -1,8 +1,8 @@ package server import ( - "git.solsynth.dev/hydrogen/identity/pkg/models" - "git.solsynth.dev/hydrogen/identity/pkg/services" + "git.solsynth.dev/hydrogen/passport/pkg/models" + "git.solsynth.dev/hydrogen/passport/pkg/services" "github.com/gofiber/contrib/websocket" "github.com/samber/lo" ) diff --git a/pkg/server/oauth_api.go b/pkg/server/oauth_api.go index 058853a..c30c578 100644 --- a/pkg/server/oauth_api.go +++ b/pkg/server/oauth_api.go @@ -4,10 +4,10 @@ import ( "strings" "time" - "git.solsynth.dev/hydrogen/identity/pkg/database" - "git.solsynth.dev/hydrogen/identity/pkg/models" - "git.solsynth.dev/hydrogen/identity/pkg/security" - "git.solsynth.dev/hydrogen/identity/pkg/services" + "git.solsynth.dev/hydrogen/passport/pkg/database" + "git.solsynth.dev/hydrogen/passport/pkg/models" + "git.solsynth.dev/hydrogen/passport/pkg/security" + "git.solsynth.dev/hydrogen/passport/pkg/services" "github.com/gofiber/fiber/v2" "github.com/samber/lo" ) @@ -77,7 +77,7 @@ func doConnect(c *fiber.Ctx) error { user, client, strings.Split(scope, " "), - []string{"identity", client.Alias}, + []string{"passport", client.Alias}, nil, lo.ToPtr(time.Now()), c.IP(), @@ -99,7 +99,7 @@ func doConnect(c *fiber.Ctx) error { user, client, strings.Split(scope, " "), - []string{"identity", client.Alias}, + []string{"passport", client.Alias}, nil, lo.ToPtr(time.Now()), c.IP(), diff --git a/pkg/server/page_api.go b/pkg/server/page_api.go index cdf2eee..680956e 100644 --- a/pkg/server/page_api.go +++ b/pkg/server/page_api.go @@ -1,8 +1,8 @@ package server import ( - "git.solsynth.dev/hydrogen/identity/pkg/database" - "git.solsynth.dev/hydrogen/identity/pkg/models" + "git.solsynth.dev/hydrogen/passport/pkg/database" + "git.solsynth.dev/hydrogen/passport/pkg/models" "github.com/gofiber/fiber/v2" ) diff --git a/pkg/server/security_api.go b/pkg/server/security_api.go index 9c934b5..d9a6730 100644 --- a/pkg/server/security_api.go +++ b/pkg/server/security_api.go @@ -1,8 +1,8 @@ package server import ( - "git.solsynth.dev/hydrogen/identity/pkg/database" - "git.solsynth.dev/hydrogen/identity/pkg/models" + "git.solsynth.dev/hydrogen/passport/pkg/database" + "git.solsynth.dev/hydrogen/passport/pkg/models" "github.com/gofiber/fiber/v2" ) diff --git a/pkg/server/startup.go b/pkg/server/startup.go index 2414ac8..08d75f3 100644 --- a/pkg/server/startup.go +++ b/pkg/server/startup.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "git.solsynth.dev/hydrogen/identity/pkg/views" + "git.solsynth.dev/hydrogen/passport/pkg/views" "github.com/gofiber/fiber/v2" "github.com/gofiber/fiber/v2/middleware/cache" "github.com/gofiber/fiber/v2/middleware/cors" diff --git a/pkg/server/userinfo..go b/pkg/server/userinfo..go index 7750c06..b008bff 100644 --- a/pkg/server/userinfo..go +++ b/pkg/server/userinfo..go @@ -1,8 +1,8 @@ package server import ( - "git.solsynth.dev/hydrogen/identity/pkg/database" - "git.solsynth.dev/hydrogen/identity/pkg/models" + "git.solsynth.dev/hydrogen/passport/pkg/database" + "git.solsynth.dev/hydrogen/passport/pkg/models" "github.com/gofiber/fiber/v2" ) diff --git a/pkg/services/accounts.go b/pkg/services/accounts.go index 8d2f90d..44fec1e 100644 --- a/pkg/services/accounts.go +++ b/pkg/services/accounts.go @@ -4,9 +4,9 @@ import ( "fmt" "time" - "git.solsynth.dev/hydrogen/identity/pkg/database" - "git.solsynth.dev/hydrogen/identity/pkg/models" - "git.solsynth.dev/hydrogen/identity/pkg/security" + "git.solsynth.dev/hydrogen/passport/pkg/database" + "git.solsynth.dev/hydrogen/passport/pkg/models" + "git.solsynth.dev/hydrogen/passport/pkg/security" "github.com/google/uuid" "github.com/samber/lo" "gorm.io/gorm" diff --git a/pkg/services/auth.go b/pkg/services/auth.go index 3bfdb16..250e7b3 100644 --- a/pkg/services/auth.go +++ b/pkg/services/auth.go @@ -4,9 +4,9 @@ import ( "fmt" "time" - "git.solsynth.dev/hydrogen/identity/pkg/database" - "git.solsynth.dev/hydrogen/identity/pkg/models" - "git.solsynth.dev/hydrogen/identity/pkg/security" + "git.solsynth.dev/hydrogen/passport/pkg/database" + "git.solsynth.dev/hydrogen/passport/pkg/models" + "git.solsynth.dev/hydrogen/passport/pkg/security" "github.com/gofiber/fiber/v2" jsoniter "github.com/json-iterator/go" "github.com/rs/zerolog/log" diff --git a/pkg/services/challanges.go b/pkg/services/challanges.go index 845fdbd..4b33a20 100644 --- a/pkg/services/challanges.go +++ b/pkg/services/challanges.go @@ -1,8 +1,8 @@ package services import ( - "git.solsynth.dev/hydrogen/identity/pkg/database" - "git.solsynth.dev/hydrogen/identity/pkg/models" + "git.solsynth.dev/hydrogen/passport/pkg/database" + "git.solsynth.dev/hydrogen/passport/pkg/models" ) func LookupChallenge(id uint) (models.AuthChallenge, error) { diff --git a/pkg/services/cleaner.go b/pkg/services/cleaner.go index 4873d57..55550a0 100644 --- a/pkg/services/cleaner.go +++ b/pkg/services/cleaner.go @@ -1,7 +1,7 @@ package services import ( - "git.solsynth.dev/hydrogen/identity/pkg/database" + "git.solsynth.dev/hydrogen/passport/pkg/database" "github.com/rs/zerolog/log" "time" ) diff --git a/pkg/services/clients.go b/pkg/services/clients.go index 0bf5454..6f98bce 100644 --- a/pkg/services/clients.go +++ b/pkg/services/clients.go @@ -3,8 +3,8 @@ package services import ( "fmt" - "git.solsynth.dev/hydrogen/identity/pkg/database" - "git.solsynth.dev/hydrogen/identity/pkg/models" + "git.solsynth.dev/hydrogen/passport/pkg/database" + "git.solsynth.dev/hydrogen/passport/pkg/models" ) func GetThirdClient(id string) (models.ThirdClient, error) { diff --git a/pkg/services/connections.go b/pkg/services/connections.go index bb18ec0..7eac47b 100644 --- a/pkg/services/connections.go +++ b/pkg/services/connections.go @@ -1,7 +1,7 @@ package services import ( - "git.solsynth.dev/hydrogen/identity/pkg/models" + "git.solsynth.dev/hydrogen/passport/pkg/models" "github.com/gofiber/contrib/websocket" ) diff --git a/pkg/services/events.go b/pkg/services/events.go index 56bfb38..66af86d 100644 --- a/pkg/services/events.go +++ b/pkg/services/events.go @@ -1,8 +1,8 @@ package services import ( - "git.solsynth.dev/hydrogen/identity/pkg/database" - "git.solsynth.dev/hydrogen/identity/pkg/models" + "git.solsynth.dev/hydrogen/passport/pkg/database" + "git.solsynth.dev/hydrogen/passport/pkg/models" ) func AddEvent(user models.Account, event, target, ip, ua string) models.ActionEvent { diff --git a/pkg/services/factors.go b/pkg/services/factors.go index 0ce9212..f7a6b41 100644 --- a/pkg/services/factors.go +++ b/pkg/services/factors.go @@ -3,8 +3,8 @@ package services import ( "fmt" - "git.solsynth.dev/hydrogen/identity/pkg/database" - "git.solsynth.dev/hydrogen/identity/pkg/models" + "git.solsynth.dev/hydrogen/passport/pkg/database" + "git.solsynth.dev/hydrogen/passport/pkg/models" "github.com/google/uuid" "github.com/spf13/viper" ) diff --git a/pkg/services/friendships.go b/pkg/services/friendships.go index 301b946..a7a8389 100644 --- a/pkg/services/friendships.go +++ b/pkg/services/friendships.go @@ -3,8 +3,8 @@ package services import ( "errors" "fmt" - "git.solsynth.dev/hydrogen/identity/pkg/database" - "git.solsynth.dev/hydrogen/identity/pkg/models" + "git.solsynth.dev/hydrogen/passport/pkg/database" + "git.solsynth.dev/hydrogen/passport/pkg/models" "gorm.io/gorm" ) diff --git a/pkg/services/notifications.go b/pkg/services/notifications.go index ca4efb0..58d1941 100644 --- a/pkg/services/notifications.go +++ b/pkg/services/notifications.go @@ -5,9 +5,9 @@ import ( jsoniter "github.com/json-iterator/go" "firebase.google.com/go/messaging" - "git.solsynth.dev/hydrogen/identity/pkg/database" - "git.solsynth.dev/hydrogen/identity/pkg/external" - "git.solsynth.dev/hydrogen/identity/pkg/models" + "git.solsynth.dev/hydrogen/passport/pkg/database" + "git.solsynth.dev/hydrogen/passport/pkg/external" + "git.solsynth.dev/hydrogen/passport/pkg/models" "github.com/rs/zerolog/log" ) diff --git a/pkg/services/sessions.go b/pkg/services/sessions.go index 8ef9ba5..47b0347 100644 --- a/pkg/services/sessions.go +++ b/pkg/services/sessions.go @@ -3,8 +3,8 @@ package services import ( "time" - "git.solsynth.dev/hydrogen/identity/pkg/database" - "git.solsynth.dev/hydrogen/identity/pkg/models" + "git.solsynth.dev/hydrogen/passport/pkg/database" + "git.solsynth.dev/hydrogen/passport/pkg/models" jsoniter "github.com/json-iterator/go" "github.com/rs/zerolog/log" "github.com/spf13/viper" diff --git a/pkg/services/tokens.go b/pkg/services/tokens.go index 4273dbb..96b4326 100644 --- a/pkg/services/tokens.go +++ b/pkg/services/tokens.go @@ -5,8 +5,8 @@ import ( "strings" "time" - "git.solsynth.dev/hydrogen/identity/pkg/database" - "git.solsynth.dev/hydrogen/identity/pkg/models" + "git.solsynth.dev/hydrogen/passport/pkg/database" + "git.solsynth.dev/hydrogen/passport/pkg/models" "github.com/google/uuid" "github.com/spf13/viper" ) diff --git a/pkg/views/package.json b/pkg/views/package.json index b771e9e..2c2ee4a 100644 --- a/pkg/views/package.json +++ b/pkg/views/package.json @@ -1,5 +1,5 @@ { - "name": "@hydrogen/identity", + "name": "@hydrogen/passport", "version": "1.0.0", "type": "module", "scripts": { diff --git a/pkg/views/src/stores/userinfo.ts b/pkg/views/src/stores/userinfo.ts index 8636dc7..d58f53c 100644 --- a/pkg/views/src/stores/userinfo.ts +++ b/pkg/views/src/stores/userinfo.ts @@ -16,11 +16,11 @@ const defaultUserinfo: Userinfo = { } export function getAtk(): string { - return new Cookie().get("identity_auth_key") + return new Cookie().get("passport_auth_key") } export function checkLoggedIn(): boolean { - return new Cookie().get("identity_auth_key") + return new Cookie().get("passport_auth_key") } export const useUserinfo = defineStore("userinfo", () => { diff --git a/settings.toml b/settings.toml index fa9c9ed..e60b3ff 100644 --- a/settings.toml +++ b/settings.toml @@ -32,6 +32,6 @@ access_token_duration = 300 refresh_token_duration = 2592000 [database] -dsn = "host=localhost dbname=hy_identity port=5432 sslmode=disable" -prefix = "identity_" +dsn = "host=localhost dbname=hy_passport port=5432 sslmode=disable" +prefix = "passport_" bolt = "uploads/bolt.db"