🚚 Renamed module due project migration
Some checks failed
continuous-integration/drone Build is failing

This commit is contained in:
Maxim Lebedev 2022-03-13 15:58:34 +05:00
parent 86f3b3d581
commit 3b0ebb3690
Signed by: toby3d
GPG Key ID: 1F14E25B7C119FC5
91 changed files with 256 additions and 257 deletions

2
go.mod
View File

@ -1,4 +1,4 @@
module source.toby3d.me/website/indieauth
module source.toby3d.me/toby3d/auth
go 1.16

View File

@ -15,12 +15,12 @@ import (
"source.toby3d.me/toby3d/form"
"source.toby3d.me/toby3d/middleware"
"source.toby3d.me/website/indieauth/internal/auth"
"source.toby3d.me/website/indieauth/internal/client"
"source.toby3d.me/website/indieauth/internal/common"
"source.toby3d.me/website/indieauth/internal/domain"
"source.toby3d.me/website/indieauth/internal/profile"
"source.toby3d.me/website/indieauth/web"
"source.toby3d.me/toby3d/auth/internal/auth"
"source.toby3d.me/toby3d/auth/internal/client"
"source.toby3d.me/toby3d/auth/internal/common"
"source.toby3d.me/toby3d/auth/internal/domain"
"source.toby3d.me/toby3d/auth/internal/profile"
"source.toby3d.me/toby3d/auth/web"
)
type (

View File

@ -11,19 +11,19 @@ import (
"golang.org/x/text/language"
"golang.org/x/text/message"
"source.toby3d.me/website/indieauth/internal/auth"
delivery "source.toby3d.me/website/indieauth/internal/auth/delivery/http"
ucase "source.toby3d.me/website/indieauth/internal/auth/usecase"
"source.toby3d.me/website/indieauth/internal/client"
clientrepo "source.toby3d.me/website/indieauth/internal/client/repository/memory"
clientucase "source.toby3d.me/website/indieauth/internal/client/usecase"
"source.toby3d.me/website/indieauth/internal/domain"
"source.toby3d.me/website/indieauth/internal/profile"
profilerepo "source.toby3d.me/website/indieauth/internal/profile/repository/memory"
"source.toby3d.me/website/indieauth/internal/session"
sessionrepo "source.toby3d.me/website/indieauth/internal/session/repository/memory"
"source.toby3d.me/website/indieauth/internal/testing/httptest"
userrepo "source.toby3d.me/website/indieauth/internal/user/repository/memory"
"source.toby3d.me/toby3d/auth/internal/auth"
delivery "source.toby3d.me/toby3d/auth/internal/auth/delivery/http"
ucase "source.toby3d.me/toby3d/auth/internal/auth/usecase"
"source.toby3d.me/toby3d/auth/internal/client"
clientrepo "source.toby3d.me/toby3d/auth/internal/client/repository/memory"
clientucase "source.toby3d.me/toby3d/auth/internal/client/usecase"
"source.toby3d.me/toby3d/auth/internal/domain"
"source.toby3d.me/toby3d/auth/internal/profile"
profilerepo "source.toby3d.me/toby3d/auth/internal/profile/repository/memory"
"source.toby3d.me/toby3d/auth/internal/session"
sessionrepo "source.toby3d.me/toby3d/auth/internal/session/repository/memory"
"source.toby3d.me/toby3d/auth/internal/testing/httptest"
userrepo "source.toby3d.me/toby3d/auth/internal/user/repository/memory"
)
type Dependencies struct {

View File

@ -3,7 +3,7 @@ package auth
import (
"context"
"source.toby3d.me/website/indieauth/internal/domain"
"source.toby3d.me/toby3d/auth/internal/domain"
)
type (

View File

@ -4,11 +4,11 @@ import (
"context"
"fmt"
"source.toby3d.me/website/indieauth/internal/auth"
"source.toby3d.me/website/indieauth/internal/domain"
"source.toby3d.me/website/indieauth/internal/profile"
"source.toby3d.me/website/indieauth/internal/random"
"source.toby3d.me/website/indieauth/internal/session"
"source.toby3d.me/toby3d/auth/internal/auth"
"source.toby3d.me/toby3d/auth/internal/domain"
"source.toby3d.me/toby3d/auth/internal/profile"
"source.toby3d.me/toby3d/auth/internal/random"
"source.toby3d.me/toby3d/auth/internal/session"
)
type authUseCase struct {

View File

@ -9,12 +9,12 @@ import (
"golang.org/x/text/language"
"golang.org/x/text/message"
"source.toby3d.me/toby3d/auth/internal/common"
"source.toby3d.me/toby3d/auth/internal/domain"
"source.toby3d.me/toby3d/auth/internal/token"
"source.toby3d.me/toby3d/auth/web"
"source.toby3d.me/toby3d/form"
"source.toby3d.me/toby3d/middleware"
"source.toby3d.me/website/indieauth/internal/common"
"source.toby3d.me/website/indieauth/internal/domain"
"source.toby3d.me/website/indieauth/internal/token"
"source.toby3d.me/website/indieauth/web"
)
type (

View File

@ -9,16 +9,16 @@ import (
"golang.org/x/text/language"
"golang.org/x/text/message"
delivery "source.toby3d.me/website/indieauth/internal/client/delivery/http"
"source.toby3d.me/website/indieauth/internal/domain"
"source.toby3d.me/website/indieauth/internal/profile"
profilerepo "source.toby3d.me/website/indieauth/internal/profile/repository/memory"
"source.toby3d.me/website/indieauth/internal/session"
sessionrepo "source.toby3d.me/website/indieauth/internal/session/repository/memory"
"source.toby3d.me/website/indieauth/internal/testing/httptest"
"source.toby3d.me/website/indieauth/internal/token"
tokenrepo "source.toby3d.me/website/indieauth/internal/token/repository/memory"
tokenucase "source.toby3d.me/website/indieauth/internal/token/usecase"
delivery "source.toby3d.me/toby3d/auth/internal/client/delivery/http"
"source.toby3d.me/toby3d/auth/internal/domain"
"source.toby3d.me/toby3d/auth/internal/profile"
profilerepo "source.toby3d.me/toby3d/auth/internal/profile/repository/memory"
"source.toby3d.me/toby3d/auth/internal/session"
sessionrepo "source.toby3d.me/toby3d/auth/internal/session/repository/memory"
"source.toby3d.me/toby3d/auth/internal/testing/httptest"
"source.toby3d.me/toby3d/auth/internal/token"
tokenrepo "source.toby3d.me/toby3d/auth/internal/token/repository/memory"
tokenucase "source.toby3d.me/toby3d/auth/internal/token/usecase"
)
type Dependencies struct {

View File

@ -3,7 +3,7 @@ package client
import (
"context"
"source.toby3d.me/website/indieauth/internal/domain"
"source.toby3d.me/toby3d/auth/internal/domain"
)
type Repository interface {

View File

@ -6,9 +6,9 @@ import (
http "github.com/valyala/fasthttp"
"source.toby3d.me/website/indieauth/internal/client"
"source.toby3d.me/website/indieauth/internal/domain"
"source.toby3d.me/website/indieauth/internal/util"
"source.toby3d.me/toby3d/auth/internal/client"
"source.toby3d.me/toby3d/auth/internal/domain"
"source.toby3d.me/toby3d/auth/internal/util"
)
type httpClientRepository struct {

View File

@ -8,10 +8,10 @@ import (
"github.com/stretchr/testify/assert"
http "github.com/valyala/fasthttp"
repository "source.toby3d.me/website/indieauth/internal/client/repository/http"
"source.toby3d.me/website/indieauth/internal/common"
"source.toby3d.me/website/indieauth/internal/domain"
"source.toby3d.me/website/indieauth/internal/testing/httptest"
repository "source.toby3d.me/toby3d/auth/internal/client/repository/http"
"source.toby3d.me/toby3d/auth/internal/common"
"source.toby3d.me/toby3d/auth/internal/domain"
"source.toby3d.me/toby3d/auth/internal/testing/httptest"
)
const testBody string = `

View File

@ -6,8 +6,8 @@ import (
"path"
"sync"
"source.toby3d.me/website/indieauth/internal/client"
"source.toby3d.me/website/indieauth/internal/domain"
"source.toby3d.me/toby3d/auth/internal/client"
"source.toby3d.me/toby3d/auth/internal/domain"
)
type memoryClientRepository struct {

View File

@ -7,8 +7,8 @@ import (
"sync"
"testing"
repository "source.toby3d.me/website/indieauth/internal/client/repository/memory"
"source.toby3d.me/website/indieauth/internal/domain"
repository "source.toby3d.me/toby3d/auth/internal/client/repository/memory"
"source.toby3d.me/toby3d/auth/internal/domain"
)
func TestGet(t *testing.T) {

View File

@ -3,7 +3,7 @@ package client
import (
"context"
"source.toby3d.me/website/indieauth/internal/domain"
"source.toby3d.me/toby3d/auth/internal/domain"
)
type UseCase interface {

View File

@ -4,8 +4,8 @@ import (
"context"
"fmt"
"source.toby3d.me/website/indieauth/internal/client"
"source.toby3d.me/website/indieauth/internal/domain"
"source.toby3d.me/toby3d/auth/internal/client"
"source.toby3d.me/toby3d/auth/internal/domain"
)
type clientUseCase struct {

View File

@ -7,9 +7,9 @@ import (
"sync"
"testing"
repository "source.toby3d.me/website/indieauth/internal/client/repository/memory"
"source.toby3d.me/website/indieauth/internal/client/usecase"
"source.toby3d.me/website/indieauth/internal/domain"
repository "source.toby3d.me/toby3d/auth/internal/client/repository/memory"
"source.toby3d.me/toby3d/auth/internal/client/usecase"
"source.toby3d.me/toby3d/auth/internal/domain"
)
func TestDiscovery(t *testing.T) {

View File

@ -4,7 +4,7 @@ package domain_test
import (
"testing"
"source.toby3d.me/website/indieauth/internal/domain"
"source.toby3d.me/toby3d/auth/internal/domain"
)
func TestParseAction(t *testing.T) {

View File

@ -4,7 +4,7 @@ import (
"fmt"
"testing"
"source.toby3d.me/website/indieauth/internal/domain"
"source.toby3d.me/toby3d/auth/internal/domain"
)
func TestParseClientID(t *testing.T) {

View File

@ -4,7 +4,7 @@ import (
"fmt"
"testing"
"source.toby3d.me/website/indieauth/internal/domain"
"source.toby3d.me/toby3d/auth/internal/domain"
)
func TestClient_ValidateRedirectURI(t *testing.T) {

View File

@ -12,8 +12,8 @@ import (
"github.com/brianvoe/gofakeit/v6"
"source.toby3d.me/website/indieauth/internal/domain"
"source.toby3d.me/website/indieauth/internal/random"
"source.toby3d.me/toby3d/auth/internal/domain"
"source.toby3d.me/toby3d/auth/internal/random"
)
func TestParseCodeChallengeMethod(t *testing.T) {

View File

@ -3,7 +3,7 @@ package domain_test
import (
"testing"
"source.toby3d.me/website/indieauth/internal/domain"
"source.toby3d.me/toby3d/auth/internal/domain"
)
func TestConfigServer_GetAddress(t *testing.T) {

View File

@ -4,7 +4,7 @@ import (
"fmt"
"testing"
"source.toby3d.me/website/indieauth/internal/domain"
"source.toby3d.me/toby3d/auth/internal/domain"
)
func TestParseEmail(t *testing.T) {

View File

@ -4,7 +4,7 @@ import (
"fmt"
"testing"
"source.toby3d.me/website/indieauth/internal/domain"
"source.toby3d.me/toby3d/auth/internal/domain"
)
func ExampleNewError() {

View File

@ -4,7 +4,7 @@ package domain_test
import (
"testing"
"source.toby3d.me/website/indieauth/internal/domain"
"source.toby3d.me/toby3d/auth/internal/domain"
)
func TestParseGrantType(t *testing.T) {

View File

@ -4,7 +4,7 @@ import (
"fmt"
"testing"
"source.toby3d.me/website/indieauth/internal/domain"
"source.toby3d.me/toby3d/auth/internal/domain"
)
func TestParseMe(t *testing.T) {

View File

@ -4,7 +4,7 @@ package domain_test
import (
"testing"
"source.toby3d.me/website/indieauth/internal/domain"
"source.toby3d.me/toby3d/auth/internal/domain"
)
func TestResponseTypeType(t *testing.T) {

View File

@ -5,7 +5,7 @@ import (
"reflect"
"testing"
"source.toby3d.me/website/indieauth/internal/domain"
"source.toby3d.me/toby3d/auth/internal/domain"
)
func TestParseScope(t *testing.T) {

View File

@ -3,7 +3,7 @@ package domain
import (
"testing"
"source.toby3d.me/website/indieauth/internal/random"
"source.toby3d.me/toby3d/auth/internal/random"
)
//nolint: tagliatelle

View File

@ -9,7 +9,7 @@ import (
"github.com/lestrrat-go/jwx/jwt"
http "github.com/valyala/fasthttp"
"source.toby3d.me/website/indieauth/internal/random"
"source.toby3d.me/toby3d/auth/internal/random"
)
type (

View File

@ -8,7 +8,7 @@ import (
http "github.com/valyala/fasthttp"
"source.toby3d.me/website/indieauth/internal/domain"
"source.toby3d.me/toby3d/auth/internal/domain"
)
func TestNewToken(t *testing.T) {

View File

@ -4,7 +4,7 @@ import (
"fmt"
"testing"
"source.toby3d.me/website/indieauth/internal/domain"
"source.toby3d.me/toby3d/auth/internal/domain"
)
func TestParseURL(t *testing.T) {

View File

@ -5,7 +5,7 @@ import (
http "github.com/valyala/fasthttp"
"source.toby3d.me/toby3d/middleware"
"source.toby3d.me/website/indieauth/internal/common"
"source.toby3d.me/toby3d/auth/internal/common"
)
type RequestHandler struct{}

View File

@ -6,8 +6,8 @@ import (
"github.com/fasthttp/router"
http "github.com/valyala/fasthttp"
delivery "source.toby3d.me/website/indieauth/internal/health/delivery/http"
"source.toby3d.me/website/indieauth/internal/testing/httptest"
delivery "source.toby3d.me/toby3d/auth/internal/health/delivery/http"
"source.toby3d.me/toby3d/auth/internal/testing/httptest"
)
func TestRequestHandler(t *testing.T) {

View File

@ -6,8 +6,8 @@ import (
http "github.com/valyala/fasthttp"
"source.toby3d.me/toby3d/middleware"
"source.toby3d.me/website/indieauth/internal/common"
"source.toby3d.me/website/indieauth/internal/domain"
"source.toby3d.me/toby3d/auth/internal/common"
"source.toby3d.me/toby3d/auth/internal/domain"
)
type (

View File

@ -7,9 +7,9 @@ import (
"github.com/goccy/go-json"
http "github.com/valyala/fasthttp"
"source.toby3d.me/website/indieauth/internal/domain"
delivery "source.toby3d.me/website/indieauth/internal/metadata/delivery/http"
"source.toby3d.me/website/indieauth/internal/testing/httptest"
"source.toby3d.me/toby3d/auth/internal/domain"
delivery "source.toby3d.me/toby3d/auth/internal/metadata/delivery/http"
"source.toby3d.me/toby3d/auth/internal/testing/httptest"
)
func TestMetadata(t *testing.T) {

View File

@ -3,7 +3,7 @@ package metadata
import (
"context"
"source.toby3d.me/website/indieauth/internal/domain"
"source.toby3d.me/toby3d/auth/internal/domain"
)
type Repository interface {

View File

@ -7,9 +7,9 @@ import (
http "github.com/valyala/fasthttp"
"source.toby3d.me/website/indieauth/internal/domain"
"source.toby3d.me/website/indieauth/internal/metadata"
"source.toby3d.me/website/indieauth/internal/util"
"source.toby3d.me/toby3d/auth/internal/domain"
"source.toby3d.me/toby3d/auth/internal/metadata"
"source.toby3d.me/toby3d/auth/internal/util"
)
type (

View File

@ -5,8 +5,8 @@ import (
"path"
"sync"
"source.toby3d.me/website/indieauth/internal/domain"
"source.toby3d.me/website/indieauth/internal/metadata"
"source.toby3d.me/toby3d/auth/internal/domain"
"source.toby3d.me/toby3d/auth/internal/metadata"
)
type memoryMetadataRepository struct {

View File

@ -3,7 +3,7 @@ package profile
import (
"context"
"source.toby3d.me/website/indieauth/internal/domain"
"source.toby3d.me/toby3d/auth/internal/domain"
)
type Repository interface {

View File

@ -6,9 +6,9 @@ import (
http "github.com/valyala/fasthttp"
"source.toby3d.me/website/indieauth/internal/domain"
"source.toby3d.me/website/indieauth/internal/profile"
"source.toby3d.me/website/indieauth/internal/util"
"source.toby3d.me/toby3d/auth/internal/domain"
"source.toby3d.me/toby3d/auth/internal/profile"
"source.toby3d.me/toby3d/auth/internal/util"
)
type httpProfileRepository struct {

View File

@ -6,8 +6,8 @@ import (
"path"
"sync"
"source.toby3d.me/website/indieauth/internal/domain"
"source.toby3d.me/website/indieauth/internal/profile"
"source.toby3d.me/toby3d/auth/internal/domain"
"source.toby3d.me/toby3d/auth/internal/profile"
)
type memoryProfileRepository struct {

View File

@ -3,7 +3,7 @@ package profile
import (
"context"
"source.toby3d.me/website/indieauth/internal/domain"
"source.toby3d.me/toby3d/auth/internal/domain"
)
type UseCase interface {

View File

@ -4,8 +4,8 @@ import (
"context"
"fmt"
"source.toby3d.me/website/indieauth/internal/domain"
"source.toby3d.me/website/indieauth/internal/profile"
"source.toby3d.me/toby3d/auth/internal/domain"
"source.toby3d.me/toby3d/auth/internal/profile"
)
type profileUseCase struct {

View File

@ -3,7 +3,7 @@ package session
import (
"context"
"source.toby3d.me/website/indieauth/internal/domain"
"source.toby3d.me/toby3d/auth/internal/domain"
)
type Repository interface {

View File

@ -7,8 +7,8 @@ import (
"sync"
"time"
"source.toby3d.me/website/indieauth/internal/domain"
"source.toby3d.me/website/indieauth/internal/session"
"source.toby3d.me/toby3d/auth/internal/domain"
"source.toby3d.me/toby3d/auth/internal/session"
)
type (

View File

@ -11,8 +11,8 @@ import (
"github.com/jmoiron/sqlx"
"source.toby3d.me/website/indieauth/internal/domain"
"source.toby3d.me/website/indieauth/internal/session"
"source.toby3d.me/toby3d/auth/internal/domain"
"source.toby3d.me/toby3d/auth/internal/session"
)
type (

View File

@ -7,9 +7,9 @@ import (
"github.com/DATA-DOG/go-sqlmock"
"source.toby3d.me/website/indieauth/internal/domain"
repository "source.toby3d.me/website/indieauth/internal/session/repository/sqlite3"
"source.toby3d.me/website/indieauth/internal/testing/sqltest"
"source.toby3d.me/toby3d/auth/internal/domain"
repository "source.toby3d.me/toby3d/auth/internal/session/repository/sqlite3"
"source.toby3d.me/toby3d/auth/internal/testing/sqltest"
)
//nolint: gochecknoglobals // slices cannot be contants

View File

@ -3,7 +3,7 @@ package session
import (
"context"
"source.toby3d.me/website/indieauth/internal/domain"
"source.toby3d.me/toby3d/auth/internal/domain"
)
type UseCase interface {

View File

@ -4,8 +4,8 @@ import (
"context"
"fmt"
"source.toby3d.me/website/indieauth/internal/domain"
"source.toby3d.me/website/indieauth/internal/session"
"source.toby3d.me/toby3d/auth/internal/domain"
"source.toby3d.me/toby3d/auth/internal/session"
)
type sessionUseCase struct {

View File

@ -14,11 +14,11 @@ import (
"source.toby3d.me/toby3d/form"
"source.toby3d.me/toby3d/middleware"
"source.toby3d.me/website/indieauth/internal/common"
"source.toby3d.me/website/indieauth/internal/domain"
"source.toby3d.me/website/indieauth/internal/random"
"source.toby3d.me/website/indieauth/internal/ticket"
"source.toby3d.me/website/indieauth/web"
"source.toby3d.me/toby3d/auth/internal/common"
"source.toby3d.me/toby3d/auth/internal/domain"
"source.toby3d.me/toby3d/auth/internal/random"
"source.toby3d.me/toby3d/auth/internal/ticket"
"source.toby3d.me/toby3d/auth/web"
)
type (

View File

@ -9,13 +9,13 @@ import (
"golang.org/x/text/language"
"golang.org/x/text/message"
"source.toby3d.me/website/indieauth/internal/common"
"source.toby3d.me/website/indieauth/internal/domain"
"source.toby3d.me/website/indieauth/internal/testing/httptest"
"source.toby3d.me/website/indieauth/internal/ticket"
delivery "source.toby3d.me/website/indieauth/internal/ticket/delivery/http"
ticketrepo "source.toby3d.me/website/indieauth/internal/ticket/repository/memory"
ucase "source.toby3d.me/website/indieauth/internal/ticket/usecase"
"source.toby3d.me/toby3d/auth/internal/common"
"source.toby3d.me/toby3d/auth/internal/domain"
"source.toby3d.me/toby3d/auth/internal/testing/httptest"
"source.toby3d.me/toby3d/auth/internal/ticket"
delivery "source.toby3d.me/toby3d/auth/internal/ticket/delivery/http"
ticketrepo "source.toby3d.me/toby3d/auth/internal/ticket/repository/memory"
ucase "source.toby3d.me/toby3d/auth/internal/ticket/usecase"
)
type Dependencies struct {

View File

@ -3,7 +3,7 @@ package ticket
import (
"context"
"source.toby3d.me/website/indieauth/internal/domain"
"source.toby3d.me/toby3d/auth/internal/domain"
)
type Repository interface {

View File

@ -7,8 +7,8 @@ import (
"sync"
"time"
"source.toby3d.me/website/indieauth/internal/domain"
"source.toby3d.me/website/indieauth/internal/ticket"
"source.toby3d.me/toby3d/auth/internal/domain"
"source.toby3d.me/toby3d/auth/internal/ticket"
)
type (

View File

@ -8,8 +8,8 @@ import (
"testing"
"time"
"source.toby3d.me/website/indieauth/internal/domain"
repository "source.toby3d.me/website/indieauth/internal/ticket/repository/memory"
"source.toby3d.me/toby3d/auth/internal/domain"
repository "source.toby3d.me/toby3d/auth/internal/ticket/repository/memory"
)
func TestCreate(t *testing.T) {

View File

@ -9,8 +9,8 @@ import (
"github.com/jmoiron/sqlx"
"source.toby3d.me/website/indieauth/internal/domain"
"source.toby3d.me/website/indieauth/internal/ticket"
"source.toby3d.me/toby3d/auth/internal/domain"
"source.toby3d.me/toby3d/auth/internal/ticket"
)
type (

View File

@ -7,9 +7,9 @@ import (
"github.com/DATA-DOG/go-sqlmock"
"source.toby3d.me/website/indieauth/internal/domain"
"source.toby3d.me/website/indieauth/internal/testing/sqltest"
repository "source.toby3d.me/website/indieauth/internal/ticket/repository/sqlite3"
"source.toby3d.me/toby3d/auth/internal/domain"
"source.toby3d.me/toby3d/auth/internal/testing/sqltest"
repository "source.toby3d.me/toby3d/auth/internal/ticket/repository/sqlite3"
)
//nolint: gochecknoglobals // slices cannot be contants

View File

@ -3,7 +3,7 @@ package ticket
import (
"context"
"source.toby3d.me/website/indieauth/internal/domain"
"source.toby3d.me/toby3d/auth/internal/domain"
)
type UseCase interface {

View File

@ -8,10 +8,10 @@ import (
json "github.com/goccy/go-json"
http "github.com/valyala/fasthttp"
"source.toby3d.me/website/indieauth/internal/common"
"source.toby3d.me/website/indieauth/internal/domain"
"source.toby3d.me/website/indieauth/internal/ticket"
"source.toby3d.me/website/indieauth/internal/util"
"source.toby3d.me/toby3d/auth/internal/common"
"source.toby3d.me/toby3d/auth/internal/domain"
"source.toby3d.me/toby3d/auth/internal/ticket"
"source.toby3d.me/toby3d/auth/internal/util"
)
type (

View File

@ -8,10 +8,10 @@ import (
"github.com/fasthttp/router"
http "github.com/valyala/fasthttp"
"source.toby3d.me/website/indieauth/internal/common"
"source.toby3d.me/website/indieauth/internal/domain"
"source.toby3d.me/website/indieauth/internal/testing/httptest"
ucase "source.toby3d.me/website/indieauth/internal/ticket/usecase"
"source.toby3d.me/toby3d/auth/internal/common"
"source.toby3d.me/toby3d/auth/internal/domain"
"source.toby3d.me/toby3d/auth/internal/testing/httptest"
ucase "source.toby3d.me/toby3d/auth/internal/ticket/usecase"
)
func TestRedeem(t *testing.T) {

View File

@ -11,10 +11,10 @@ import (
"source.toby3d.me/toby3d/form"
"source.toby3d.me/toby3d/middleware"
"source.toby3d.me/website/indieauth/internal/common"
"source.toby3d.me/website/indieauth/internal/domain"
"source.toby3d.me/website/indieauth/internal/ticket"
"source.toby3d.me/website/indieauth/internal/token"
"source.toby3d.me/toby3d/auth/internal/common"
"source.toby3d.me/toby3d/auth/internal/domain"
"source.toby3d.me/toby3d/auth/internal/ticket"
"source.toby3d.me/toby3d/auth/internal/token"
)
type (

View File

@ -10,20 +10,20 @@ import (
json "github.com/goccy/go-json"
http "github.com/valyala/fasthttp"
"source.toby3d.me/website/indieauth/internal/common"
"source.toby3d.me/website/indieauth/internal/domain"
"source.toby3d.me/website/indieauth/internal/profile"
profilerepo "source.toby3d.me/website/indieauth/internal/profile/repository/memory"
"source.toby3d.me/website/indieauth/internal/session"
sessionrepo "source.toby3d.me/website/indieauth/internal/session/repository/memory"
"source.toby3d.me/website/indieauth/internal/testing/httptest"
"source.toby3d.me/website/indieauth/internal/ticket"
ticketrepo "source.toby3d.me/website/indieauth/internal/ticket/repository/memory"
ticketucase "source.toby3d.me/website/indieauth/internal/ticket/usecase"
"source.toby3d.me/website/indieauth/internal/token"
delivery "source.toby3d.me/website/indieauth/internal/token/delivery/http"
tokenrepo "source.toby3d.me/website/indieauth/internal/token/repository/memory"
tokenucase "source.toby3d.me/website/indieauth/internal/token/usecase"
"source.toby3d.me/toby3d/auth/internal/common"
"source.toby3d.me/toby3d/auth/internal/domain"
"source.toby3d.me/toby3d/auth/internal/profile"
profilerepo "source.toby3d.me/toby3d/auth/internal/profile/repository/memory"
"source.toby3d.me/toby3d/auth/internal/session"
sessionrepo "source.toby3d.me/toby3d/auth/internal/session/repository/memory"
"source.toby3d.me/toby3d/auth/internal/testing/httptest"
"source.toby3d.me/toby3d/auth/internal/ticket"
ticketrepo "source.toby3d.me/toby3d/auth/internal/ticket/repository/memory"
ticketucase "source.toby3d.me/toby3d/auth/internal/ticket/usecase"
"source.toby3d.me/toby3d/auth/internal/token"
delivery "source.toby3d.me/toby3d/auth/internal/token/delivery/http"
tokenrepo "source.toby3d.me/toby3d/auth/internal/token/repository/memory"
tokenucase "source.toby3d.me/toby3d/auth/internal/token/usecase"
)
type Dependencies struct {

View File

@ -3,7 +3,7 @@ package token
import (
"context"
"source.toby3d.me/website/indieauth/internal/domain"
"source.toby3d.me/toby3d/auth/internal/domain"
)
type Repository interface {

View File

@ -6,8 +6,8 @@ import (
"path"
"sync"
"source.toby3d.me/website/indieauth/internal/domain"
"source.toby3d.me/website/indieauth/internal/token"
"source.toby3d.me/toby3d/auth/internal/domain"
"source.toby3d.me/toby3d/auth/internal/token"
)
type memoryTokenRepository struct {

View File

@ -8,9 +8,9 @@ import (
"github.com/stretchr/testify/assert"
"source.toby3d.me/website/indieauth/internal/domain"
"source.toby3d.me/website/indieauth/internal/token"
repository "source.toby3d.me/website/indieauth/internal/token/repository/memory"
"source.toby3d.me/toby3d/auth/internal/domain"
"source.toby3d.me/toby3d/auth/internal/token"
repository "source.toby3d.me/toby3d/auth/internal/token/repository/memory"
)
func TestCreate(t *testing.T) {

View File

@ -10,8 +10,8 @@ import (
"github.com/jmoiron/sqlx"
"source.toby3d.me/website/indieauth/internal/domain"
"source.toby3d.me/website/indieauth/internal/token"
"source.toby3d.me/toby3d/auth/internal/domain"
"source.toby3d.me/toby3d/auth/internal/token"
)
type (

View File

@ -7,9 +7,9 @@ import (
"github.com/DATA-DOG/go-sqlmock"
"source.toby3d.me/website/indieauth/internal/domain"
"source.toby3d.me/website/indieauth/internal/testing/sqltest"
repository "source.toby3d.me/website/indieauth/internal/token/repository/sqlite3"
"source.toby3d.me/toby3d/auth/internal/domain"
"source.toby3d.me/toby3d/auth/internal/testing/sqltest"
repository "source.toby3d.me/toby3d/auth/internal/token/repository/sqlite3"
)
//nolint: gochecknoglobals // slices cannot be contants

View File

@ -3,7 +3,7 @@ package token
import (
"context"
"source.toby3d.me/website/indieauth/internal/domain"
"source.toby3d.me/toby3d/auth/internal/domain"
)
type (

View File

@ -8,10 +8,10 @@ import (
"github.com/lestrrat-go/jwx/jwa"
"github.com/lestrrat-go/jwx/jwt"
"source.toby3d.me/website/indieauth/internal/domain"
"source.toby3d.me/website/indieauth/internal/profile"
"source.toby3d.me/website/indieauth/internal/session"
"source.toby3d.me/website/indieauth/internal/token"
"source.toby3d.me/toby3d/auth/internal/domain"
"source.toby3d.me/toby3d/auth/internal/profile"
"source.toby3d.me/toby3d/auth/internal/session"
"source.toby3d.me/toby3d/auth/internal/token"
)
type (
@ -91,13 +91,12 @@ func (uc *tokenUseCase) Exchange(ctx context.Context, opts token.ExchangeOptions
}
func (uc *tokenUseCase) Verify(ctx context.Context, accessToken string) (*domain.Token, *domain.Profile, error) {
find, err := uc.tokens.Get(ctx, accessToken)
if err != nil && !errors.Is(err, token.ErrNotExist) {
return nil, nil, fmt.Errorf("cannot check token in store: %w", err)
}
if _, err := uc.tokens.Get(ctx, accessToken); err != nil {
if errors.Is(err, token.ErrNotExist) {
return nil, nil, token.ErrRevoke
}
if find != nil {
return nil, nil, token.ErrRevoke
return nil, nil, fmt.Errorf("cannot check token in store: %w", err)
}
tkn, err := jwt.ParseString(accessToken, jwt.WithVerify(jwa.SignatureAlgorithm(uc.config.JWT.Algorithm),

View File

@ -9,14 +9,14 @@ import (
"github.com/stretchr/testify/assert"
"source.toby3d.me/website/indieauth/internal/domain"
"source.toby3d.me/website/indieauth/internal/profile"
profilerepo "source.toby3d.me/website/indieauth/internal/profile/repository/memory"
"source.toby3d.me/website/indieauth/internal/session"
sessionrepo "source.toby3d.me/website/indieauth/internal/session/repository/memory"
"source.toby3d.me/website/indieauth/internal/token"
tokenrepo "source.toby3d.me/website/indieauth/internal/token/repository/memory"
usecase "source.toby3d.me/website/indieauth/internal/token/usecase"
"source.toby3d.me/toby3d/auth/internal/domain"
"source.toby3d.me/toby3d/auth/internal/profile"
profilerepo "source.toby3d.me/toby3d/auth/internal/profile/repository/memory"
"source.toby3d.me/toby3d/auth/internal/session"
sessionrepo "source.toby3d.me/toby3d/auth/internal/session/repository/memory"
"source.toby3d.me/toby3d/auth/internal/token"
tokenrepo "source.toby3d.me/toby3d/auth/internal/token/repository/memory"
usecase "source.toby3d.me/toby3d/auth/internal/token/usecase"
)
type Dependencies struct {

View File

@ -9,9 +9,9 @@ import (
http "github.com/valyala/fasthttp"
"source.toby3d.me/toby3d/middleware"
"source.toby3d.me/website/indieauth/internal/common"
"source.toby3d.me/website/indieauth/internal/domain"
"source.toby3d.me/website/indieauth/internal/token"
"source.toby3d.me/toby3d/auth/internal/common"
"source.toby3d.me/toby3d/auth/internal/domain"
"source.toby3d.me/toby3d/auth/internal/token"
)
type (

View File

@ -9,16 +9,16 @@ import (
"github.com/goccy/go-json"
http "github.com/valyala/fasthttp"
"source.toby3d.me/website/indieauth/internal/domain"
"source.toby3d.me/website/indieauth/internal/profile"
profilerepo "source.toby3d.me/website/indieauth/internal/profile/repository/memory"
"source.toby3d.me/website/indieauth/internal/session"
sessionrepo "source.toby3d.me/website/indieauth/internal/session/repository/memory"
"source.toby3d.me/website/indieauth/internal/testing/httptest"
"source.toby3d.me/website/indieauth/internal/token"
tokenrepo "source.toby3d.me/website/indieauth/internal/token/repository/memory"
tokenucase "source.toby3d.me/website/indieauth/internal/token/usecase"
delivery "source.toby3d.me/website/indieauth/internal/user/delivery/http"
"source.toby3d.me/toby3d/auth/internal/domain"
"source.toby3d.me/toby3d/auth/internal/profile"
profilerepo "source.toby3d.me/toby3d/auth/internal/profile/repository/memory"
"source.toby3d.me/toby3d/auth/internal/session"
sessionrepo "source.toby3d.me/toby3d/auth/internal/session/repository/memory"
"source.toby3d.me/toby3d/auth/internal/testing/httptest"
"source.toby3d.me/toby3d/auth/internal/token"
tokenrepo "source.toby3d.me/toby3d/auth/internal/token/repository/memory"
tokenucase "source.toby3d.me/toby3d/auth/internal/token/usecase"
delivery "source.toby3d.me/toby3d/auth/internal/user/delivery/http"
)
type Dependencies struct {

View File

@ -3,7 +3,7 @@ package user
import (
"context"
"source.toby3d.me/website/indieauth/internal/domain"
"source.toby3d.me/toby3d/auth/internal/domain"
)
type Repository interface {

View File

@ -6,9 +6,9 @@ import (
http "github.com/valyala/fasthttp"
"source.toby3d.me/website/indieauth/internal/domain"
"source.toby3d.me/website/indieauth/internal/user"
"source.toby3d.me/website/indieauth/internal/util"
"source.toby3d.me/toby3d/auth/internal/domain"
"source.toby3d.me/toby3d/auth/internal/user"
"source.toby3d.me/toby3d/auth/internal/util"
)
type httpUserRepository struct {

View File

@ -10,10 +10,10 @@ import (
"github.com/stretchr/testify/assert"
http "github.com/valyala/fasthttp"
"source.toby3d.me/website/indieauth/internal/common"
"source.toby3d.me/website/indieauth/internal/domain"
"source.toby3d.me/website/indieauth/internal/testing/httptest"
repository "source.toby3d.me/website/indieauth/internal/user/repository/http"
"source.toby3d.me/toby3d/auth/internal/common"
"source.toby3d.me/toby3d/auth/internal/domain"
"source.toby3d.me/toby3d/auth/internal/testing/httptest"
repository "source.toby3d.me/toby3d/auth/internal/user/repository/http"
)
const testBody string = `

View File

@ -5,8 +5,8 @@ import (
"path"
"sync"
"source.toby3d.me/website/indieauth/internal/domain"
"source.toby3d.me/website/indieauth/internal/user"
"source.toby3d.me/toby3d/auth/internal/domain"
"source.toby3d.me/toby3d/auth/internal/user"
)
type memoryUserRepository struct {

View File

@ -7,8 +7,8 @@ import (
"sync"
"testing"
"source.toby3d.me/website/indieauth/internal/domain"
repository "source.toby3d.me/website/indieauth/internal/user/repository/memory"
"source.toby3d.me/toby3d/auth/internal/domain"
repository "source.toby3d.me/toby3d/auth/internal/user/repository/memory"