🚚 Rename package
This commit is contained in:
parent
3437d32273
commit
55a20e18bb
2
.github/workflows/nightly.yml
vendored
2
.github/workflows/nightly.yml
vendored
@ -25,4 +25,4 @@ jobs:
|
||||
context: .
|
||||
file: ./Dockerfile
|
||||
push: true
|
||||
tags: xsheep2010/passport:nightly
|
||||
tags: xsheep2010/identity:nightly
|
||||
|
0
.idea/Passport.iml → .idea/Identity.iml
generated
0
.idea/Passport.iml → .idea/Identity.iml
generated
2
.idea/modules.xml
generated
2
.idea/modules.xml
generated
@ -2,7 +2,7 @@
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/Passport.iml" filepath="$PROJECT_DIR$/.idea/Passport.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/Identity.iml" filepath="$PROJECT_DIR$/.idea/Identity.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
@ -1,5 +1,5 @@
|
||||
# Building Backend
|
||||
FROM golang:alpine as passport-server
|
||||
FROM golang:alpine as identity-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=passport-server /dist /passport/server
|
||||
COPY --from=identity-server /dist /identity/server
|
||||
|
||||
EXPOSE 8444
|
||||
|
||||
CMD ["/passport/server"]
|
||||
CMD ["/identity/server"]
|
2
go.mod
2
go.mod
@ -1,4 +1,4 @@
|
||||
module code.smartsheep.studio/hydrogen/passport
|
||||
module code.smartsheep.studio/hydrogen/identity
|
||||
|
||||
go 1.21.5
|
||||
|
||||
|
@ -1,14 +1,14 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"code.smartsheep.studio/hydrogen/passport/pkg/external"
|
||||
"code.smartsheep.studio/hydrogen/passport/pkg/server"
|
||||
"code.smartsheep.studio/hydrogen/identity/pkg/external"
|
||||
"code.smartsheep.studio/hydrogen/identity/pkg/server"
|
||||
"os"
|
||||
"os/signal"
|
||||
"syscall"
|
||||
|
||||
passport "code.smartsheep.studio/hydrogen/passport/pkg"
|
||||
"code.smartsheep.studio/hydrogen/passport/pkg/database"
|
||||
identity "code.smartsheep.studio/hydrogen/identity/pkg"
|
||||
"code.smartsheep.studio/hydrogen/identity/pkg/database"
|
||||
"github.com/rs/zerolog"
|
||||
"github.com/rs/zerolog/log"
|
||||
"github.com/spf13/viper"
|
||||
@ -51,11 +51,11 @@ func main() {
|
||||
go server.Listen()
|
||||
|
||||
// Messages
|
||||
log.Info().Msgf("Passport v%s is started...", passport.AppVersion)
|
||||
log.Info().Msgf("Passport v%s is started...", identity.AppVersion)
|
||||
|
||||
quit := make(chan os.Signal, 1)
|
||||
signal.Notify(quit, syscall.SIGINT, syscall.SIGTERM)
|
||||
<-quit
|
||||
|
||||
log.Info().Msgf("Passport v%s is quitting...", passport.AppVersion)
|
||||
log.Info().Msgf("Passport v%s is quitting...", identity.AppVersion)
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
package database
|
||||
|
||||
import (
|
||||
"code.smartsheep.studio/hydrogen/passport/pkg/models"
|
||||
"code.smartsheep.studio/hydrogen/identity/pkg/models"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
package passport
|
||||
package identity
|
||||
|
||||
const (
|
||||
AppVersion = "1.0.0"
|
||||
|
@ -4,8 +4,8 @@ import (
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"code.smartsheep.studio/hydrogen/passport/pkg/database"
|
||||
"code.smartsheep.studio/hydrogen/passport/pkg/models"
|
||||
"code.smartsheep.studio/hydrogen/identity/pkg/database"
|
||||
"code.smartsheep.studio/hydrogen/identity/pkg/models"
|
||||
"github.com/samber/lo"
|
||||
"gorm.io/datatypes"
|
||||
)
|
||||
|
@ -1,7 +1,7 @@
|
||||
package security
|
||||
|
||||
import (
|
||||
"code.smartsheep.studio/hydrogen/passport/pkg/models"
|
||||
"code.smartsheep.studio/hydrogen/identity/pkg/models"
|
||||
"fmt"
|
||||
"github.com/samber/lo"
|
||||
)
|
||||
|
@ -5,8 +5,8 @@ import (
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"code.smartsheep.studio/hydrogen/passport/pkg/database"
|
||||
"code.smartsheep.studio/hydrogen/passport/pkg/models"
|
||||
"code.smartsheep.studio/hydrogen/identity/pkg/database"
|
||||
"code.smartsheep.studio/hydrogen/identity/pkg/models"
|
||||
"github.com/google/uuid"
|
||||
"github.com/samber/lo"
|
||||
)
|
||||
|
@ -1,9 +1,9 @@
|
||||
package server
|
||||
|
||||
import (
|
||||
"code.smartsheep.studio/hydrogen/passport/pkg/database"
|
||||
"code.smartsheep.studio/hydrogen/passport/pkg/models"
|
||||
"code.smartsheep.studio/hydrogen/passport/pkg/services"
|
||||
"code.smartsheep.studio/hydrogen/identity/pkg/database"
|
||||
"code.smartsheep.studio/hydrogen/identity/pkg/models"
|
||||
"code.smartsheep.studio/hydrogen/identity/pkg/services"
|
||||
"fmt"
|
||||
"github.com/gofiber/fiber/v2"
|
||||
jsoniter "github.com/json-iterator/go"
|
||||
|
@ -1,8 +1,8 @@
|
||||
package server
|
||||
|
||||
import (
|
||||
"code.smartsheep.studio/hydrogen/passport/pkg/security"
|
||||
"code.smartsheep.studio/hydrogen/passport/pkg/services"
|
||||
"code.smartsheep.studio/hydrogen/identity/pkg/security"
|
||||
"code.smartsheep.studio/hydrogen/identity/pkg/services"
|
||||
"github.com/gofiber/fiber/v2"
|
||||
"github.com/gofiber/fiber/v2/middleware/keyauth"
|
||||
)
|
||||
|
@ -1,8 +1,8 @@
|
||||
package server
|
||||
|
||||
import (
|
||||
"code.smartsheep.studio/hydrogen/passport/pkg/database"
|
||||
"code.smartsheep.studio/hydrogen/passport/pkg/models"
|
||||
"code.smartsheep.studio/hydrogen/identity/pkg/database"
|
||||
"code.smartsheep.studio/hydrogen/identity/pkg/models"
|
||||
"github.com/gofiber/fiber/v2"
|
||||
"github.com/google/uuid"
|
||||
"github.com/spf13/viper"
|
||||
|
@ -4,8 +4,8 @@ import (
|
||||
"github.com/gofiber/fiber/v2"
|
||||
"time"
|
||||
|
||||
"code.smartsheep.studio/hydrogen/passport/pkg/security"
|
||||
"code.smartsheep.studio/hydrogen/passport/pkg/services"
|
||||
"code.smartsheep.studio/hydrogen/identity/pkg/security"
|
||||
"code.smartsheep.studio/hydrogen/identity/pkg/services"
|
||||
"github.com/samber/lo"
|
||||
)
|
||||
|
||||
@ -69,7 +69,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{"passport"}, nil, lo.ToPtr(time.Now()))
|
||||
session, err := security.GrantSession(challenge, []string{"*"}, []string{"identity"}, nil, lo.ToPtr(time.Now()))
|
||||
if err != nil {
|
||||
return fiber.NewError(fiber.StatusBadRequest, err.Error())
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
package server
|
||||
|
||||
import (
|
||||
"code.smartsheep.studio/hydrogen/passport/pkg/services"
|
||||
"code.smartsheep.studio/hydrogen/identity/pkg/services"
|
||||
"github.com/gofiber/fiber/v2"
|
||||
)
|
||||
|
||||
|
@ -1,9 +1,9 @@
|
||||
package server
|
||||
|
||||
import (
|
||||
"code.smartsheep.studio/hydrogen/passport/pkg/database"
|
||||
"code.smartsheep.studio/hydrogen/passport/pkg/models"
|
||||
"code.smartsheep.studio/hydrogen/passport/pkg/services"
|
||||
"code.smartsheep.studio/hydrogen/identity/pkg/database"
|
||||
"code.smartsheep.studio/hydrogen/identity/pkg/models"
|
||||
"code.smartsheep.studio/hydrogen/identity/pkg/services"
|
||||
"github.com/gofiber/fiber/v2"
|
||||
"github.com/samber/lo"
|
||||
"time"
|
||||
|
@ -1,8 +1,8 @@
|
||||
package server
|
||||
|
||||
import (
|
||||
"code.smartsheep.studio/hydrogen/passport/pkg/models"
|
||||
"code.smartsheep.studio/hydrogen/passport/pkg/services"
|
||||
"code.smartsheep.studio/hydrogen/identity/pkg/models"
|
||||
"code.smartsheep.studio/hydrogen/identity/pkg/services"
|
||||
"github.com/gofiber/fiber/v2"
|
||||
)
|
||||
|
||||
|
@ -1,10 +1,10 @@
|
||||
package server
|
||||
|
||||
import (
|
||||
"code.smartsheep.studio/hydrogen/passport/pkg/database"
|
||||
"code.smartsheep.studio/hydrogen/passport/pkg/models"
|
||||
"code.smartsheep.studio/hydrogen/passport/pkg/security"
|
||||
"code.smartsheep.studio/hydrogen/passport/pkg/services"
|
||||
"code.smartsheep.studio/hydrogen/identity/pkg/database"
|
||||
"code.smartsheep.studio/hydrogen/identity/pkg/models"
|
||||
"code.smartsheep.studio/hydrogen/identity/pkg/security"
|
||||
"code.smartsheep.studio/hydrogen/identity/pkg/services"
|
||||
"github.com/gofiber/fiber/v2"
|
||||
"github.com/samber/lo"
|
||||
"strings"
|
||||
@ -76,7 +76,7 @@ func doConnect(c *fiber.Ctx) error {
|
||||
user,
|
||||
client,
|
||||
strings.Split(scope, " "),
|
||||
[]string{"passport", client.Alias},
|
||||
[]string{"identity", client.Alias},
|
||||
nil,
|
||||
lo.ToPtr(time.Now()),
|
||||
c.IP(),
|
||||
@ -98,7 +98,7 @@ func doConnect(c *fiber.Ctx) error {
|
||||
user,
|
||||
client,
|
||||
strings.Split(scope, " "),
|
||||
[]string{"passport", client.Alias},
|
||||
[]string{"identity", client.Alias},
|
||||
nil,
|
||||
lo.ToPtr(time.Now()),
|
||||
c.IP(),
|
||||
|
@ -1,8 +1,8 @@
|
||||
package server
|
||||
|
||||
import (
|
||||
"code.smartsheep.studio/hydrogen/passport/pkg/database"
|
||||
"code.smartsheep.studio/hydrogen/passport/pkg/models"
|
||||
"code.smartsheep.studio/hydrogen/identity/pkg/database"
|
||||
"code.smartsheep.studio/hydrogen/identity/pkg/models"
|
||||
"github.com/gofiber/fiber/v2"
|
||||
)
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
package server
|
||||
|
||||
import (
|
||||
"code.smartsheep.studio/hydrogen/passport/pkg/view"
|
||||
"code.smartsheep.studio/hydrogen/identity/pkg/view"
|
||||
"github.com/gofiber/fiber/v2"
|
||||
"github.com/gofiber/fiber/v2/middleware/cache"
|
||||
"github.com/gofiber/fiber/v2/middleware/cors"
|
||||
|
@ -1,9 +1,9 @@
|
||||
package services
|
||||
|
||||
import (
|
||||
"code.smartsheep.studio/hydrogen/passport/pkg/database"
|
||||
"code.smartsheep.studio/hydrogen/passport/pkg/models"
|
||||
"code.smartsheep.studio/hydrogen/passport/pkg/security"
|
||||
"code.smartsheep.studio/hydrogen/identity/pkg/database"
|
||||
"code.smartsheep.studio/hydrogen/identity/pkg/models"
|
||||
"code.smartsheep.studio/hydrogen/identity/pkg/security"
|
||||
"fmt"
|
||||
"github.com/google/uuid"
|
||||
"github.com/samber/lo"
|
||||
|
@ -1,8 +1,8 @@
|
||||
package services
|
||||
|
||||
import (
|
||||
"code.smartsheep.studio/hydrogen/passport/pkg/database"
|
||||
"code.smartsheep.studio/hydrogen/passport/pkg/models"
|
||||
"code.smartsheep.studio/hydrogen/identity/pkg/database"
|
||||
"code.smartsheep.studio/hydrogen/identity/pkg/models"
|
||||
)
|
||||
|
||||
func LookupChallenge(id uint) (models.AuthChallenge, error) {
|
||||
|
@ -1,8 +1,8 @@
|
||||
package services
|
||||
|
||||
import (
|
||||
"code.smartsheep.studio/hydrogen/passport/pkg/database"
|
||||
"code.smartsheep.studio/hydrogen/passport/pkg/models"
|
||||
"code.smartsheep.studio/hydrogen/identity/pkg/database"
|
||||
"code.smartsheep.studio/hydrogen/identity/pkg/models"
|
||||
"fmt"
|
||||
)
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
package services
|
||||
|
||||
import (
|
||||
"code.smartsheep.studio/hydrogen/passport/pkg/database"
|
||||
"code.smartsheep.studio/hydrogen/passport/pkg/models"
|
||||
"code.smartsheep.studio/hydrogen/identity/pkg/database"
|
||||
"code.smartsheep.studio/hydrogen/identity/pkg/models"
|
||||
)
|
||||
|
||||
func AddEvent(user models.Account, event, target, ip, ua string) models.ActionEvent {
|
||||
|
@ -1,8 +1,8 @@
|
||||
package services
|
||||
|
||||
import (
|
||||
"code.smartsheep.studio/hydrogen/passport/pkg/database"
|
||||
"code.smartsheep.studio/hydrogen/passport/pkg/models"
|
||||
"code.smartsheep.studio/hydrogen/identity/pkg/database"
|
||||
"code.smartsheep.studio/hydrogen/identity/pkg/models"
|
||||
"fmt"
|
||||
"github.com/google/uuid"
|
||||
"github.com/spf13/viper"
|
||||
|
@ -1,9 +1,9 @@
|
||||
package services
|
||||
|
||||
import (
|
||||
"code.smartsheep.studio/hydrogen/passport/pkg/database"
|
||||
"code.smartsheep.studio/hydrogen/passport/pkg/external"
|
||||
"code.smartsheep.studio/hydrogen/passport/pkg/models"
|
||||
"code.smartsheep.studio/hydrogen/identity/pkg/database"
|
||||
"code.smartsheep.studio/hydrogen/identity/pkg/external"
|
||||
"code.smartsheep.studio/hydrogen/identity/pkg/models"
|
||||
"context"
|
||||
"firebase.google.com/go/messaging"
|
||||
"github.com/rs/zerolog/log"
|
||||
|
@ -1,8 +1,8 @@
|
||||
package services
|
||||
|
||||
import (
|
||||
"code.smartsheep.studio/hydrogen/passport/pkg/database"
|
||||
"code.smartsheep.studio/hydrogen/passport/pkg/models"
|
||||
"code.smartsheep.studio/hydrogen/identity/pkg/database"
|
||||
"code.smartsheep.studio/hydrogen/identity/pkg/models"
|
||||
)
|
||||
|
||||
func LookupSessionWithToken(tokenId string) (models.AuthSession, error) {
|
||||
|
@ -1,8 +1,8 @@
|
||||
package services
|
||||
|
||||
import (
|
||||
"code.smartsheep.studio/hydrogen/passport/pkg/database"
|
||||
"code.smartsheep.studio/hydrogen/passport/pkg/models"
|
||||
"code.smartsheep.studio/hydrogen/identity/pkg/database"
|
||||
"code.smartsheep.studio/hydrogen/identity/pkg/models"
|
||||
"fmt"
|
||||
"github.com/google/uuid"
|
||||
"github.com/spf13/viper"
|
||||
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"name": "@hydrogen/passport-web",
|
||||
"name": "@hydrogen/identity-web",
|
||||
"private": true,
|
||||
"version": "0.0.0",
|
||||
"type": "module",
|
||||
|
1682
pkg/view/yarn.lock
Normal file
1682
pkg/view/yarn.lock
Normal file
File diff suppressed because it is too large
Load Diff
@ -22,8 +22,8 @@ username = "alphabot@smartsheep.studio"
|
||||
password = "gz937Zxxzfcd9SeH"
|
||||
|
||||
[database]
|
||||
dsn = "host=localhost dbname=hy_passport port=5432 sslmode=disable"
|
||||
prefix = "passport_"
|
||||
dsn = "host=localhost dbname=hy_identity port=5432 sslmode=disable"
|
||||
prefix = "identity_"
|
||||
|
||||
[[directory]]
|
||||
name = "Goatpass"
|
||||
|
Loading…
Reference in New Issue
Block a user