-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
28 changed files
with
131 additions
and
99 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 14 additions & 3 deletions
17
services/backend/integration-tests/endpoints/user/get_user_permissions_test.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,30 @@ | ||
package user | ||
|
||
import ( | ||
"encoding/json" | ||
"io" | ||
"net/http" | ||
"testing" | ||
|
||
"github.com/uvulpos/golang-sveltekit-template/integration-tests/helper/setup" | ||
"gotest.tools/assert" | ||
|
||
httpUserModel "github.com/uvulpos/golang-sveltekit-template/src/resources/user/http/http-models" | ||
) | ||
|
||
func TestGetUserPermissions(t *testing.T) { | ||
testData := setup.SetupTest(t) | ||
testData.AuthenticateAsUser(t, "") | ||
testData.AuthenticateAsUser(t, "TIRIEDL") | ||
|
||
response := testData.MakeRequest(t, http.MethodGet, "/api/v1/self/permissions", nil) | ||
response := testData.MakeRequest(t, http.MethodGet, "/api/v1/self", nil) | ||
defer response.Body.Close() | ||
|
||
assert.Equal(t, "", "", "") | ||
responseBytes, responseBytesErr := io.ReadAll(response.Body) | ||
assert.Equal(t, responseBytesErr, nil, "could not read body of http request") | ||
|
||
var selfUserInformation httpUserModel.SelfInformationModel | ||
unmarshalErr := json.Unmarshal(responseBytes, &selfUserInformation) | ||
assert.Equal(t, unmarshalErr, nil, "could not unmarshal http request") | ||
|
||
assert.Equal(t, selfUserInformation.Username, "TIRIEDL", "blabla") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
package service | ||
|
||
func (s *AuthService) Logout() (string, error) { | ||
return s.auth.Logout() | ||
return s.authentikProviderSvc.Logout() | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
package service | ||
|
||
func (s *AuthService) CreateRedirect(state string) string { | ||
return s.auth.CreateRedirect(state) | ||
return s.authentikProviderSvc.CreateRedirect(state) | ||
} |
24 changes: 0 additions & 24 deletions
24
services/backend/src/resources/identity-provider/auth/storage/handler.go
This file was deleted.
Oops, something went wrong.
10 changes: 10 additions & 0 deletions
10
services/backend/src/resources/user/service/create_user.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package service | ||
|
||
import ( | ||
"github.com/go-sqlx/sqlx" | ||
"github.com/uvulpos/golang-sveltekit-template/src/helper/customerrors" | ||
) | ||
|
||
func (s *UserService) CreateUser(tx *sqlx.Tx, name, prefName, email string, emailVerified bool) (string, customerrors.ErrorInterface) { | ||
return "ID", nil | ||
} |
16 changes: 16 additions & 0 deletions
16
services/backend/src/resources/user/service/create_user_login_identity.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package service | ||
|
||
import ( | ||
"github.com/go-sqlx/sqlx" | ||
"github.com/uvulpos/golang-sveltekit-template/src/helper/customerrors" | ||
providerConst "github.com/uvulpos/golang-sveltekit-template/src/resources/auth/service/provider-const" | ||
) | ||
|
||
func (*UserService) CreateUserLoginIdentity( | ||
tx *sqlx.Tx, | ||
createdUserID string, | ||
providerType providerConst.AuthProvider, | ||
providerID string, | ||
) customerrors.ErrorInterface { | ||
return nil | ||
} |
12 changes: 12 additions & 0 deletions
12
services/backend/src/resources/user/service/get_user_id_by_login.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package service | ||
|
||
import ( | ||
"errors" | ||
|
||
"github.com/uvulpos/golang-sveltekit-template/src/helper/customerrors" | ||
providerConst "github.com/uvulpos/golang-sveltekit-template/src/resources/auth/service/provider-const" | ||
) | ||
|
||
func (s *UserService) GetUserIDByLogin(providerType providerConst.AuthProvider, providerID string) (string, customerrors.ErrorInterface) { | ||
return "", customerrors.NewInternalServerError(errors.New("function not implemented"), "", "function not implemented") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.