Skip to content

Commit

Permalink
feat: adding standard auth lib
Browse files Browse the repository at this point in the history
  • Loading branch information
ericzorn93 committed Jan 7, 2025
1 parent 5f5b37f commit 6738e02
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 1 deletion.
3 changes: 2 additions & 1 deletion go.work
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ use (
./apps/services/accounts-graphql
./apps/services/accounts-worker
./apps/services/inbound-webhooks-api
./libs/backend/httpauth
./libs/backend/auth
./libs/backend/boot
./libs/backend/cache
./libs/backend/domain/user
./libs/backend/eventing
./libs/backend/httpauth
./libs/backend/proto-gen/go
)
6 changes: 6 additions & 0 deletions libs/backend/auth/auth.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package auth

func Auth(name string) string {
result := "Auth " + name
return result
}
12 changes: 12 additions & 0 deletions libs/backend/auth/auth_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package auth

import (
"testing"
)

func TestAuth(t *testing.T) {
result := Auth("works")
if result != "Auth works" {
t.Error("Expected Auth to append 'works'")
}
}
3 changes: 3 additions & 0 deletions libs/backend/auth/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module libs/backend/auth

go 1.23
18 changes: 18 additions & 0 deletions libs/backend/auth/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "auth",
"$schema": "../../../node_modules/nx/schemas/project-schema.json",
"projectType": "library",
"sourceRoot": "libs/backend/auth",
"tags": ["api", "services", "auth"],
"targets": {
"test": {
"executor": "@nx-go/nx-go:test"
},
"lint": {
"executor": "@nx-go/nx-go:lint"
},
"tidy": {
"executor": "@nx-go/nx-go:tidy"
}
}
}

0 comments on commit 6738e02

Please sign in to comment.