From c10b0353281df816d056d3bf7af89c2e5d444612 Mon Sep 17 00:00:00 2001 From: Marc Bir Date: Mon, 20 Oct 2025 16:31:25 -0700 Subject: [PATCH 1/2] switch the openapi service to GenService to allow service implementation evolution simplify pgx model - purge where clause - minor fmt cleanup - move all models into a single model.go file bumped deps --- cfg/config_test.go | 2 +- foji/foji.yaml | 6 +- foji/openapi/service.go.tpl | 25 +++--- foji/pgx/db.go.tpl | 6 -- foji/pgx/model.go.tpl | 53 ++++++------- foji/pgx/table.go.tpl | 148 ++++-------------------------------- go.mod | 30 ++------ go.sum | 95 +++-------------------- tests/auth/foji.yaml | 1 + tests/auth/service.go | 4 +- tests/auth/service_gen.go | 78 +++++++++++++++++++ tests/go.mod | 6 +- tests/go.sum | 4 + 13 files changed, 163 insertions(+), 295 deletions(-) create mode 100644 tests/auth/service_gen.go diff --git a/cfg/config_test.go b/cfg/config_test.go index 84c388c..4cc6204 100644 --- a/cfg/config_test.go +++ b/cfg/config_test.go @@ -129,7 +129,7 @@ func TestOutput_All(t *testing.T) { name string want stringlist.StringMap }{ - {"openAPIStub", stringlist.StringMap{"!swagger.yaml": "foji/openapi/stub.yaml.tpl"}}, + {"openAPIStub", stringlist.StringMap{"!openapi.yaml": "foji/openapi/stub.yaml.tpl"}}, {"embed", stringlist.StringMap{}}, {"groupTest", stringlist.StringMap{}}, } diff --git a/foji/foji.yaml b/foji/foji.yaml index d3d3a67..a6293b4 100644 --- a/foji/foji.yaml +++ b/foji/foji.yaml @@ -89,12 +89,12 @@ processes: openAPIStub: format: openapi DbAll: - '!swagger.yaml': foji/openapi/stub.yaml.tpl + '!openapi.yaml': foji/openapi/stub.yaml.tpl openAPI: format: go resources: [ api ] OpenAPIFile: 'models_gen.go': foji/openapi/model.go.tpl - '!service.go': foji/openapi/service.go.tpl - 'http_handler_gen.go': foji/openapi/handler.go.tpl + 'service_gen.go': foji/openapi/service.go.tpl + 'handlers_gen.go': foji/openapi/handler.go.tpl '!cmd/serve/main.go': foji/openapi/main.go.tpl diff --git a/foji/openapi/service.go.tpl b/foji/openapi/service.go.tpl index e2b0c36..6980a57 100644 --- a/foji/openapi/service.go.tpl +++ b/foji/openapi/service.go.tpl @@ -34,13 +34,8 @@ import ( {{- end }} ) -// New creates a new service instance. -func New() *Service { - return &Service{} -} - -// Service implements all business logic for {{ .PackageName }}. -type Service struct { +// GenService holds all Unsupported mock endpoints {{ .PackageName }}. +type GenService struct { } {{- range $name, $path := .File.API.Paths.Map }} @@ -49,13 +44,13 @@ type Service struct { {{ goDoc (pascal $op.OperationID) }} {{- goDoc $op.Summary }} {{- goDoc $op.Description }} -func (s *Service) {{ pascal $op.OperationID}}(ctx context.Context, - {{- template "methodSignature" ($.WithParams "op" $op "path" $path "package" $.PackageName) }}{ - {{- $response := $.GetOpHappyResponseType $.PackageName $op}} - return - {{- if notEmpty $response -}}nil, {{ end -}} - {{- if gt (len ($.GetOpHappyResponseHeaders $.PackageName $op)) 0 -}}http.Header{}, {{ end -}} - errors.ErrUnsupported -} +func (s *GenService) {{ pascal $op.OperationID}}(ctx context.Context, +{{- template "methodSignature" ($.WithParams "op" $op "path" $path "package" $.PackageName) }}{ +{{- $response := $.GetOpHappyResponseType $.PackageName $op}} +{{- if notEmpty $response }} + return nil, errors.ErrUnsupported +{{- else }} + return errors.ErrUnsupported +{{- end }}} {{- end }} {{- end }} \ No newline at end of file diff --git a/foji/pgx/db.go.tpl b/foji/pgx/db.go.tpl index f4a3be8..0bc1302 100644 --- a/foji/pgx/db.go.tpl +++ b/foji/pgx/db.go.tpl @@ -4,8 +4,6 @@ package pg import ( "context" - "database/sql" - "errors" "github.com/jackc/pgx/v5/pgconn" "github.com/jackc/pgx/v5" @@ -18,10 +16,6 @@ type DB interface { QueryRow(context.Context, string, ...any) pgx.Row } -func IsErrNoRows(err error) bool { - return errors.Is(err, pgx.ErrNoRows) || errors.Is(err, sql.ErrNoRows) -} - type Repo struct { db DB } diff --git a/foji/pgx/model.go.tpl b/foji/pgx/model.go.tpl index 73aa0a6..d93d862 100644 --- a/foji/pgx/model.go.tpl +++ b/foji/pgx/model.go.tpl @@ -1,36 +1,33 @@ // Code generated by foji {{ version }}, template: {{ templateFile }}; DO NOT EDIT. -{{- $table := .Table.Name}} -{{- $goName := case .Table.Name -}} -{{- $colNames := .Table.Columns.ByOrdinal.Names }} -{{- $pkNames := cases .Table.PrimaryKeys.ByOrdinal.Names }} -package {{ $.PackageName }} +package {{ .PackageName }} import ( "fmt" - -{{- range .Imports }} - "{{ . }}" -{{- end }} + "time" ) -// {{$goName}} represents a record from '{{.Schema.Name}}.{{$table}}'. -type {{$goName}} struct { -{{- range .Table.Columns.ByOrdinal }} - {{ case .Name }} {{ $.GetType . $.PackageName }} `json:"{{ .Name }},omitempty"` -{{- end }} -} - -func (r {{$goName}}) String() string { - return fmt.Sprintf( "{{$goName}}{ - {{- csv ($pkNames.Sprintf "%s:%%v" ) }}}", - {{- csv ($pkNames.Sprintf "r.%s" ) }}) -} - -// Field values for every column in {{.Table.Name}}. These are used for custom where clause queries -var ( -{{- range .Table.Columns.ByOrdinal }} - {{$goName}}{{case .Name}} {{ title (replaceEach ( $.GetType . $.PackageName) "" "." "*" "{" "}" ) }}Field = "{{ .Name }}" -{{- end}} -) +{{ range .DB }} + {{ range .Tables }} + + {{- $table := .Name}} + {{- $goName := case .Name -}} + {{- $colNames := .Columns.ByOrdinal.Names }} + {{- $pkNames := cases .PrimaryKeys.ByOrdinal.Names }} + + // {{$goName}} represents a record from '{{.Schema.Name}}.{{$table}}'. + type {{$goName}} struct { + {{- range .Columns.ByOrdinal }} + {{ case .Name }} {{ $.GetType . $.PackageName }} + {{- end }} + } + + func (r {{$goName}}) String() string { + return fmt.Sprintf( "{{$goName}}{ + {{- csv ($pkNames.Sprintf "%s:%%v" ) }}}", + {{- csv ($pkNames.Sprintf "r.%s" ) }}) + } + + {{end}} +{{end}} diff --git a/foji/pgx/table.go.tpl b/foji/pgx/table.go.tpl index be93a3a..1854f6a 100644 --- a/foji/pgx/table.go.tpl +++ b/foji/pgx/table.go.tpl @@ -32,6 +32,7 @@ FROM {{$schema}}.{{$table}} ` func scan{{$goName}}(rr pgx.Rows) ([]*{{$.PackageName}}.{{$goName}}, error) { var result []*{{$.PackageName}}.{{$goName}} + for rr.Next() { row := {{$.PackageName}}.{{$goName}}{} err := rr.Scan({{ csv $scanFields }}) @@ -40,15 +41,18 @@ func scan{{$goName}}(rr pgx.Rows) ([]*{{$.PackageName}}.{{$goName}}, error) { } result = append(result, &row) } + return result, nil } func scanOne{{$goName}}(rr pgx.Row) (*{{$.PackageName}}.{{$goName}}, error) { row := {{$.PackageName}}.{{$goName}}{} + err := rr.Scan({{ csv $scanFields }}) if err != nil { return nil, fmt.Errorf("{{$goName}}:%w", err) } + return &row, nil } @@ -58,67 +62,15 @@ func (r Repo) All{{$goName}}(ctx context.Context) ([]*{{$.PackageName}}.{{$goNam {{- if $hasSoftDeletes -}} + `WHERE deleted_at is NULL ` {{- end}} - q, err := r.db.Query(ctx,query) - if err != nil { - return nil, fmt.Errorf("{{$goName}}:%w", err) - } - return scan{{$goName}}(q) -} -// Count gets size of '{{$table}}'. -func (r Repo) Count{{$goName}}(ctx context.Context, where {{$.PackageName}}.WhereClause) (int, error) { - idx := 1 - query := `SELECT - count(*) as count - FROM {{$schema}}.{{$table}} - WHERE ` + where.String(&idx) - - count := 0 - return count, r.db.QueryRow(ctx, query, where.Values()...).Scan(&count) -} - -// Select retrieves rows from '{{$table}}' as a slice of {{$goName}}. -func (r Repo) Select{{$goName}}(ctx context.Context, where {{$.PackageName}}.WhereClause) ([]*{{$.PackageName}}.{{$goName}}, error) { - idx := 1 - query := querySelect{{$goName}} + " WHERE " + where.String(&idx) -{{- if $hasSoftDeletes -}} - + ` AND deleted_at is NULL ` -{{- end}} - - q, err := r.db.Query(ctx, query, where.Values()...) + q, err := r.db.Query(ctx,query) if err != nil { return nil, fmt.Errorf("{{$goName}}:%w", err) } - return scan{{$goName}}(q) -} - -// SelectOrder retrieves rows from '{{$table}}' as a slice of {{$goName}} in a particular order. -func (r Repo) SelectOrder{{$goName}}(ctx context.Context, where {{$.PackageName}}.WhereClause, orderBy {{$.PackageName}}.OrderByClause) ([]*{{$.PackageName}}.{{$goName}}, error) { - idx := 1 - query := querySelect{{$goName}} + " WHERE " + where.String(&idx) -{{- if $hasSoftDeletes -}} - + ` AND deleted_at is NULL ` -{{- end}} + " " + orderBy.String() - q, err := r.db.Query(ctx, query, where.Values()...) - if err != nil { - return nil, fmt.Errorf("{{$goName}}:%w", err) - } return scan{{$goName}}(q) } -// First retrieve one row from '{{$table}}' when sorted by orderBy. -func (r Repo) First{{$goName}}(ctx context.Context, where {{$.PackageName}}.WhereClause, orderBy {{$.PackageName}}.OrderByClause) (*{{$.PackageName}}.{{$goName}}, error) { - idx := 1 - query := querySelect{{$goName}} + " WHERE " + where.String(&idx) -{{- if $hasSoftDeletes -}} - + ` AND deleted_at is NULL ` -{{- end}} + " " + orderBy.String() + " LIMIT 1" - - q := r.db.QueryRow(ctx, query, where.Values()...) - return scanOne{{$goName}}(q) -} - {{- /* Takes the number of values to produce and produces a list of postgres placeholders of the form $1, $2, etc */}} {{- define "values" -}} @@ -157,29 +109,20 @@ func (r Repo) Update{{$goName}}(ctx context.Context, row *{{$.PackageName}}.{{$g {{- end}}` _, err := r.db.Exec(ctx, query, {{csv $mutableFields }}, {{$PKFields}}) - return fmt.Errorf("{{$goName}}:%w", err) - } -{{end}} -// Set sets a single column on an existing row in the database. -func (r Repo) Set{{$goName}}(ctx context.Context, set {{$.PackageName}}.Where, where {{$.PackageName}}.WhereClause) (int64, error) { - idx := 2 - query := `UPDATE {{$schema}}.{{$table}} SET ` + - set.Field + " = $1 " + - `WHERE ` + - where.String(&idx) - - res, err := r.db.Exec(ctx, query, append([]any{ set.Value }, where.Values()...)...) if err != nil { - return 0, fmt.Errorf("{{$goName}}:%w", err) + return fmt.Errorf("Update{{$goName}}:%w", err) } - return res.RowsAffected(), nil + + return nil } +{{end}} + {{- if .Table.HasPrimaryKey }} {{- if $hasSoftDeletes}} // Delete{{$goName}} soft deletes the row from the database. Returns the number of items soft deleted. -{{else}} +{{- else}} // Delete{{$goName}} deletes the Row from the database. Returns the number of items deleted. -{{end}} +{{- end}} func (r Repo) Delete{{$goName}}( ctx context.Context, {{ $.Parameterize .Table.PrimaryKeys "%s %s" $pkgName }}) (int64, error) { {{- if $hasSoftDeletes}} const query = `UPDATE {{$schema}}.{{$table}} @@ -194,12 +137,14 @@ func (r Repo) Delete{{$goName}}( ctx context.Context, {{ $.Parameterize .Table.P {{ range $x, $name := .Table.PrimaryKeys.Names.Sort -}} {{$name}} = ${{inc $x}}{{if lt $x (sum (len $.Table.PrimaryKeys) -1)}} AND {{end}} {{- end}}`{{- end}} + res, err := r.db.Exec(ctx, query, {{- csv .Table.PrimaryKeys.Names.Sort.Camel -}} ) if err != nil { return 0, fmt.Errorf("{{$goName}}:%w", err) } + return res.RowsAffected(), nil } {{- if $hasSoftDeletes}} @@ -210,79 +155,18 @@ func (r Repo) DeletePermanent{{$goName}}( ctx context.Context, {{ $.Parameterize {{ range $x, $name := .Table.PrimaryKeys.Names.Sort -}} {{$name}} = ${{inc $x}}{{if lt $x (sum (len $.Table.PrimaryKeys) -1)}} AND {{end}} {{- end}}` + res, err := r.db.Exec(ctx, query, {{- csv .Table.PrimaryKeys.Names.Sort.Camel -}} ) if err != nil { return 0, fmt.Errorf("{{$goName}}:%w", err) } + return res.RowsAffected(), nil } {{end}} {{end}} -// DeleteWhere{{$goName}} deletes Rows from the database and returns the number of rows deleted. -func (r Repo) DeleteWhere{{$goName}}(ctx context.Context, where {{$.PackageName}}.WhereClause) (int64, error) { - idx := 1 -{{ if $hasSoftDeletes}} - query := `UPDATE {{$schema}}.{{$table}} - SET deleted_at = now() - WHERE ` + where.String(&idx) + ` AND deleted_at is NULL` -{{ else }} - query := `DELETE FROM {{$schema}}.{{$table}} - WHERE ` + where.String(&idx) -{{ end }} - res, err := r.db.Exec(ctx, query, where.Values()...) - if err != nil { - return 0, fmt.Errorf("{{$goName}}:%w", err) - } - return res.RowsAffected(), nil -} -{{ if $hasSoftDeletes}} -// UndeleteWhere{{$goName}} undeletes the Row from the database. -func (r Repo) Undelete{{$goName}}(ctx context.Context, {{ $.Parameterize .Table.PrimaryKeys "%s %s" $pkgName }}) (int64, error) { - query := `UPDATE {{$schema}}.{{$table}} - SET deleted_at = NULL - WHERE -{{- range $x, $name := .Table.PrimaryKeys.Names.Sort }} - {{$name}} = ${{inc $x}}{{if lt $x (sum (len $.Table.PrimaryKeys) -1)}} AND {{end}} -{{- end}} AND deleted_at is not NULL` - - res, err := r.db.Exec(ctx, query, {{ csv .Table.PrimaryKeys.Names.Sort.Camel -}}) - if err != nil { - return 0, fmt.Errorf("{{$goName}}:%w", err) - } - return res.RowsAffected(), nil -} - -// DeleteWherePermanent{{$goName}} deletes the Row from the database. This bypasses the soft delete mechanism. -// Returns the number of items deleted. -func (r Repo) DeleteWherePermanent{{$goName}}(ctx context.Context, where {{$.PackageName}}.WhereClause) (int64, error) { - idx := 1 - query := `DELETE FROM {{$schema}}.{{$table}} - WHERE ` + where.String(&idx) - - res, err := r.db.Exec(ctx, query, where.Values()...) - if err != nil { - return 0, fmt.Errorf("{{$goName}}:%w", err) - } - return res.RowsAffected(), nil -} - -// UndeleteWhere{{$goName}} undeletes the Row from the database. -func (r Repo) UndeleteWhere{{$goName}}(ctx context.Context, where {{$.PackageName}}.WhereClause) (int64, error) { - idx := 1 - query := `UPDATE {{$schema}}.{{$table}} - SET deleted_at = null - WHERE ` + where.String(&idx) + ` AND deleted_at is NOT NULL` - - res, err := r.db.Exec(ctx, query, where.Values()...) - if err != nil { - return 0, fmt.Errorf("{{$goName}}:%w", err) - } - return res.RowsAffected(), nil -} - -{{ end -}} {{ range .Table.Indexes -}} {{- $FuncName := print $goName "By" ((cases .Columns.Names).Join "") -}} diff --git a/go.mod b/go.mod index 9061ca3..ae1e0ba 100644 --- a/go.mod +++ b/go.mod @@ -1,15 +1,13 @@ module github.com/gofoji/foji -go 1.24.0 - -toolchain go1.24.1 +go 1.25.0 require ( github.com/codemodus/kace v0.5.1 github.com/getkin/kin-openapi v0.133.0 github.com/go-sprout/sprout v1.0.2 - github.com/gofoji/plates v0.3.2 - github.com/gofoji/plates/plush v0.3.3 + github.com/gofoji/plates v0.3.3 + github.com/gofoji/plates/plush v0.3.4 github.com/jackc/pgx/v5 v5.7.6 github.com/jinzhu/inflection v1.0.0 github.com/rs/zerolog v1.34.0 @@ -22,21 +20,12 @@ require ( require ( dario.cat/mergo v1.0.2 // indirect github.com/Masterminds/semver/v3 v3.4.0 // indirect - github.com/aymerick/douceur v0.2.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/fatih/structs v1.1.0 // indirect github.com/go-openapi/jsonpointer v0.22.1 // indirect github.com/go-openapi/swag/jsonname v0.25.1 // indirect github.com/gobuffalo/flect v1.0.3 // indirect - github.com/gobuffalo/github_flavored_markdown v1.1.4 // indirect - github.com/gobuffalo/helpers v0.6.10 // indirect - github.com/gobuffalo/plush/v4 v4.1.22 // indirect - github.com/gobuffalo/plush/v5 v5.0.9 // indirect - github.com/gobuffalo/tags/v3 v3.1.4 // indirect - github.com/gobuffalo/validate/v3 v3.3.3 // indirect - github.com/gofrs/uuid v4.4.0+incompatible // indirect + github.com/gobuffalo/plush/v5 v5.0.10 // indirect github.com/google/uuid v1.6.0 // indirect - github.com/gorilla/css v1.0.1 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jackc/pgpassfile v1.0.0 // indirect github.com/jackc/pgservicefile v0.0.0-20240606120523-5a60cdf6a761 // indirect @@ -44,7 +33,6 @@ require ( github.com/mailru/easyjson v0.9.1 // indirect github.com/mattn/go-colorable v0.1.14 // indirect github.com/mattn/go-isatty v0.0.20 // indirect - github.com/microcosm-cc/bluemonday v1.0.27 // indirect github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/reflectwalk v1.0.2 // indirect github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect @@ -52,14 +40,10 @@ require ( github.com/oasdiff/yaml3 v0.0.0-20250309153720-d2182401db90 // indirect github.com/perimeterx/marshmallow v1.1.5 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/sergi/go-diff v1.4.0 // indirect - github.com/sourcegraph/annotate v0.0.0-20160123013949-f4cad6c6324d // indirect - github.com/sourcegraph/syntaxhighlight v0.0.0-20170531221838-bd320f5d308e // indirect github.com/spf13/cast v1.10.0 // indirect github.com/spf13/pflag v1.0.10 // indirect github.com/woodsbury/decimal128 v1.4.0 // indirect - golang.org/x/crypto v0.42.0 // indirect - golang.org/x/net v0.44.0 // indirect - golang.org/x/sys v0.36.0 // indirect - golang.org/x/text v0.29.0 // indirect + golang.org/x/crypto v0.43.0 // indirect + golang.org/x/sys v0.37.0 // indirect + golang.org/x/text v0.30.0 // indirect ) diff --git a/go.sum b/go.sum index 90df72c..435240f 100644 --- a/go.sum +++ b/go.sum @@ -2,8 +2,6 @@ dario.cat/mergo v1.0.2 h1:85+piFYR1tMbRrLcDwR18y4UKJ3aH1Tbzi24VRW1TK8= dario.cat/mergo v1.0.2/go.mod h1:E/hbnu0NxMFBjpMIE34DRGLWqDy0g5FuKDhCb31ngxA= github.com/Masterminds/semver/v3 v3.4.0 h1:Zog+i5UMtVoCU8oKka5P7i9q9HgrJeGzI9SA1Xbatp0= github.com/Masterminds/semver/v3 v3.4.0/go.mod h1:4V+yj/TJE1HU9XfppCwVMZq3I84lprf4nC11bSS5beM= -github.com/aymerick/douceur v0.2.0 h1:Mv+mAeH1Q+n9Fr+oyamOlAkUNPWPlA8PPGR0QAaYuPk= -github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4= github.com/codemodus/kace v0.5.1 h1:4OCsBlE2c/rSJo375ggfnucv9eRzge/U5LrrOZd47HA= github.com/codemodus/kace v0.5.1/go.mod h1:coddaHoX1ku1YFSe4Ip0mL9kQjJvKkzb9CfIdG1YR04= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= @@ -25,38 +23,23 @@ github.com/go-sprout/sprout v1.0.2 h1:sAtDB94vqOa+OczpuzD2lklIaNRmG7DK18loVQ+3zT github.com/go-sprout/sprout v1.0.2/go.mod h1:HlUXnn3tkTfOj3QKV5q24SX3jN/oUesty1+4ssFaU94= github.com/go-test/deep v1.0.8 h1:TDsG77qcSprGbC6vTN8OuXp5g+J+b5Pcguhf7Zt61VM= github.com/go-test/deep v1.0.8/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE= -github.com/gobuffalo/flect v0.3.0/go.mod h1:5pf3aGnsvqvCj50AVni7mJJF8ICxGZ8HomberC3pXLE= github.com/gobuffalo/flect v1.0.3 h1:xeWBM2nui+qnVvNM4S3foBhCAL2XgPU+a7FdpelbTq4= github.com/gobuffalo/flect v1.0.3/go.mod h1:A5msMlrHtLqh9umBSnvabjsMrCcCpAyzglnDvkbYKHs= -github.com/gobuffalo/github_flavored_markdown v1.1.3/go.mod h1:IzgO5xS6hqkDmUh91BW/+Qxo/qYnvfzoz3A7uLkg77I= -github.com/gobuffalo/github_flavored_markdown v1.1.4 h1:WacrEGPXUDX+BpU1GM/Y0ADgMzESKNWls9hOTG1MHVs= -github.com/gobuffalo/github_flavored_markdown v1.1.4/go.mod h1:Vl9686qrVVQou4GrHRK/KOG3jCZOKLUqV8MMOAYtlso= -github.com/gobuffalo/helpers v0.6.7/go.mod h1:j0u1iC1VqlCaJEEVkZN8Ia3TEzfj/zoXANqyJExTMTA= -github.com/gobuffalo/helpers v0.6.10 h1:puKDCOrJ0EIq5ScnTRgKyvEZ05xQa+gwRGCpgoh6Ek8= -github.com/gobuffalo/helpers v0.6.10/go.mod h1:r52L6VSnByLJFOmURp1irvzgSakk7RodChi1YbGwk8I= -github.com/gobuffalo/plush/v4 v4.1.22 h1:bPQr5PsiTg54UGMsfvnIAvFmUfxzD/ri+wbpu7PlmTM= -github.com/gobuffalo/plush/v4 v4.1.22/go.mod h1:WiKHJx3qBvfaDVlrv8zT7NCd3dEMaVR/fVxW4wqV17M= -github.com/gobuffalo/plush/v5 v5.0.9 h1:7b+I3xpwHciJB0+lCN5HYQSGR/VzcRZgiXlbGkDL1Pg= -github.com/gobuffalo/plush/v5 v5.0.9/go.mod h1:C08u/VEqzzPBXFF/yqs40P/5Cvc/zlZsMzhCxXyWJmU= +github.com/gobuffalo/plush/v5 v5.0.10 h1:IJ6qI4zjNT9FxqDrE0f9w4z8PVe9XXeuu7vY0792iOk= +github.com/gobuffalo/plush/v5 v5.0.10/go.mod h1:C08u/VEqzzPBXFF/yqs40P/5Cvc/zlZsMzhCxXyWJmU= github.com/gobuffalo/tags/v3 v3.1.4 h1:X/ydLLPhgXV4h04Hp2xlbI2oc5MDaa7eub6zw8oHjsM= github.com/gobuffalo/tags/v3 v3.1.4/go.mod h1:ArRNo3ErlHO8BtdA0REaZxijuWnWzF6PUXngmMXd2I0= -github.com/gobuffalo/validate/v3 v3.3.3 h1:o7wkIGSvZBYBd6ChQoLxkz2y1pfmhbI4jNJYh6PuNJ4= -github.com/gobuffalo/validate/v3 v3.3.3/go.mod h1:YC7FsbJ/9hW/VjQdmXPvFqvRis4vrRYFxr69WiNZw6g= github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= github.com/gofoji/plates v0.3.2 h1:JSkN4Fwvy196tAsWau1W8wetAbCMkaEsxXooJGqEtL4= github.com/gofoji/plates v0.3.2/go.mod h1:dMu4ksz2zTMiXjTPjKQ5KVbqPc7mAHucGGmLsMmlaeE= -github.com/gofoji/plates/plush v0.3.3 h1:wOGQaolEw3RAUat2t7avAj8aNe8gfepcnKljAMGYVfo= -github.com/gofoji/plates/plush v0.3.3/go.mod h1:GKS1gr8vB9I3VZCBVVU0MNBPOI19qpn48rTowz+BwG0= -github.com/gofrs/uuid v4.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= -github.com/gofrs/uuid v4.4.0+incompatible h1:3qXRTX8/NbyulANqlc0lchS1gqAVxRgsuW1YrTJupqA= -github.com/gofrs/uuid v4.4.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= +github.com/gofoji/plates v0.3.3 h1:MfBu5TtWHxxEBKoGngi1FA2MhcRfjm0odl6ouis9rhs= +github.com/gofoji/plates v0.3.3/go.mod h1:KOsI6hw+5gWEc/9Igg7bAbauc3IhKQwdOAMgv+FYeMo= +github.com/gofoji/plates/plush v0.3.4 h1:bIfDe7lyeiorGT0dfKtADTAyl78qFT8wvxqf+bQfsr0= +github.com/gofoji/plates/plush v0.3.4/go.mod h1:HpaeN9+sN0BYw41AEGjB86nL3hFVo71BUzfYjbmIB08= github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/gorilla/css v1.0.0/go.mod h1:Dn721qIggHpt4+EFCcTLTU/vk5ySda2ReITrtgBl60c= -github.com/gorilla/css v1.0.1 h1:ntNaBIghp6JmvWnxbZKANoLyuXTPZ4cAMlo6RyhlbO8= -github.com/gorilla/css v1.0.1/go.mod h1:BvnYkspnSzMmwRK+b8/xgNPLiIuNZr6vbZBTPQ2A3b0= github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM= @@ -71,11 +54,8 @@ github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY= github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/mailru/easyjson v0.9.1 h1:LbtsOm5WAswyWbvTEOqhypdPeZzHavpZx96/n553mR8= @@ -87,10 +67,6 @@ github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/ github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY= github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= -github.com/microcosm-cc/bluemonday v1.0.20/go.mod h1:yfBmMi8mxvaZut3Yytv+jTXRY8mxyjJ0/kQBTElld50= -github.com/microcosm-cc/bluemonday v1.0.22/go.mod h1:ytNkv4RrDrLJ2pqlsSI46O6IVXmZOBBD4SaJyDwwTkM= -github.com/microcosm-cc/bluemonday v1.0.27 h1:MpEUotklkwCSLeH+Qdx1VJgNqLlpY2KXwXFM08ygZfk= -github.com/microcosm-cc/bluemonday v1.0.27/go.mod h1:jFi9vgW+H7c3V0lb6nR74Ib/DIB5OBs92Dimizgw2cA= github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= @@ -112,14 +88,6 @@ github.com/rs/xid v1.6.0/go.mod h1:7XoLgs4eV+QndskICGsho+ADou8ySMSjJKDIan90Nz0= github.com/rs/zerolog v1.34.0 h1:k43nTLIwcTVQAncfCw4KZ2VY6ukYoZaBPNOE8txlOeY= github.com/rs/zerolog v1.34.0/go.mod h1:bJsvje4Z08ROH4Nhs5iH600c3IkWhwp44iRc54W6wYQ= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= -github.com/sergi/go-diff v1.2.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= -github.com/sergi/go-diff v1.3.1/go.mod h1:aMJSSKb2lpPvRNec0+w3fl7LP9IOFzdc9Pa4NFbPK1I= -github.com/sergi/go-diff v1.4.0 h1:n/SP9D5ad1fORl+llWyN+D6qoUETXNZARKjyY2/KVCw= -github.com/sergi/go-diff v1.4.0/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4= -github.com/sourcegraph/annotate v0.0.0-20160123013949-f4cad6c6324d h1:yKm7XZV6j9Ev6lojP2XaIshpT4ymkqhMeSghO5Ps00E= -github.com/sourcegraph/annotate v0.0.0-20160123013949-f4cad6c6324d/go.mod h1:UdhH50NIW0fCiwBSr0co2m7BnFLdv4fQTgdqdJTHFeE= -github.com/sourcegraph/syntaxhighlight v0.0.0-20170531221838-bd320f5d308e h1:qpG93cPwA5f7s/ZPBJnGOYQNK/vKsaDaseuKT5Asee8= -github.com/sourcegraph/syntaxhighlight v0.0.0-20170531221838-bd320f5d308e/go.mod h1:HuIsMU8RRBOtsCgI77wP899iHVBQpCmg4ErYMZB+2IA= github.com/spf13/cast v1.10.0 h1:h2x0u2shc1QuLHfxi+cTJvs30+ZAHOGRic8uyGTDWxY= github.com/spf13/cast v1.10.0/go.mod h1:jNfB8QC9IA6ZuY2ZjDp0KtFO2LZZlg4S/7bzP6qqeHo= github.com/spf13/cobra v1.10.1 h1:lJeBwCfmrnXthfAupyUTzJ/J4Nc1RsHC/mSRU2dll/s= @@ -133,12 +101,10 @@ github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpE github.com/stretchr/objx v0.5.2 h1:xuMeJ0Sdp5ZMRXx/aWO6RZxdr3beISkG5/G/aIRr3pY= github.com/stretchr/objx v0.5.2/go.mod h1:FRsXN1f5AsAjCGJKqEizvkpNtU+EGNCLh3NxZ/8L+MA= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= github.com/ugorji/go/codec v1.2.7 h1:YPXUKf7fYbp/y8xloBqZOw2qaVggbfwMlI8WM3wZUJ0= @@ -147,57 +113,20 @@ github.com/woodsbury/decimal128 v1.4.0 h1:xJATj7lLu4f2oObouMt2tgGiElE5gO6mSWUjQs github.com/woodsbury/decimal128 v1.4.0/go.mod h1:BP46FUrVjVhdTbKT+XuQh2xfQaGki9LMIRJSFuh6THU= github.com/yoheimuta/go-protoparser/v4 v4.14.2 h1:/P/LlX1CF9NaTWEltGcIZVvNlPbhABuAnBtAWpb3+74= github.com/yoheimuta/go-protoparser/v4 v4.14.2/go.mod h1:AHNNnSWnb0UoL4QgHPiOAg2BniQceFscPI5X/BZNHl8= -github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.42.0 h1:chiH31gIWm57EkTXpwnqf8qeuMUi0yekh6mT2AvFlqI= -golang.org/x/crypto v0.42.0/go.mod h1:4+rDnOTJhQCx2q7/j6rAN5XDw8kPjeaXEUR2eL94ix8= -golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= -golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.0.0-20220826154423-83b083e8dc8b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= -golang.org/x/net v0.0.0-20221002022538-bcab6841153b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= -golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.44.0 h1:evd8IRDyfNBMBTTY5XRF1vaZlD+EmWx6x8PkhR04H/I= -golang.org/x/net v0.44.0/go.mod h1:ECOoLqd5U3Lhyeyo/QDCEVQ4sNgYsqvCZ722XogGieY= -golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= +golang.org/x/crypto v0.43.0 h1:dduJYIi3A3KOfdGOHX8AVZ/jGiyPa3IbBozJ5kNuE04= +golang.org/x/crypto v0.43.0/go.mod h1:BFbav4mRNlXJL4wNeejLpWxB7wMbc79PdRGhWKncxR0= golang.org/x/sync v0.17.0 h1:l60nONMj9l5drqw6jlhIELNv9I0A4OFgRsG9k2oT9Ug= golang.org/x/sync v0.17.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI= -golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220728004956-3c1f35247d10/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.36.0 h1:KVRy2GtZBrk1cBYA7MKu5bEZFxQk4NIDV6RLVcC8o0k= -golang.org/x/sys v0.36.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= -golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.29.0 h1:1neNs90w9YzJ9BocxfsQNHKuAT4pkghyXc4nhZ6sJvk= -golang.org/x/text v0.29.0/go.mod h1:7MhJOA9CD2qZyOKYazxdYMF85OwPdEr9jTtBpO7ydH4= -golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= -golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/sys v0.37.0 h1:fdNQudmxPjkdUTPnLn5mdQv7Zwvbvpaxqs831goi9kQ= +golang.org/x/sys v0.37.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= +golang.org/x/text v0.30.0 h1:yznKA/E9zq54KzlzBEAWn1NXSQ8DIp/NYMy88xJjl4k= +golang.org/x/text v0.30.0/go.mod h1:yDdHFIX9t+tORqspjENWgzaCVXgk0yYnYuSZ8UzzBVM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/tests/auth/foji.yaml b/tests/auth/foji.yaml index 2558b18..65c9eea 100644 --- a/tests/auth/foji.yaml +++ b/tests/auth/foji.yaml @@ -10,3 +10,4 @@ processes: OpenAPIFile: 'tests/auth/http_handler_gen.go': foji/openapi/handler.go.tpl 'tests/auth/model_gen.go': foji/openapi/model.go.tpl + 'tests/auth/service_gen.go': foji/openapi/service.go.tpl diff --git a/tests/auth/service.go b/tests/auth/service.go index a5eca68..3796da7 100644 --- a/tests/auth/service.go +++ b/tests/auth/service.go @@ -6,7 +6,9 @@ import ( "tests/example" ) -type Service struct{} +type Service struct { + GenService +} func (s *Service) ListAdminUsers(ctx context.Context, user *example.ExampleAuth) ([]User, error) { return nil, nil diff --git a/tests/auth/service_gen.go b/tests/auth/service_gen.go new file mode 100644 index 0000000..b89878d --- /dev/null +++ b/tests/auth/service_gen.go @@ -0,0 +1,78 @@ +package auth + +import ( + "context" + "errors" + + "tests/example" +) + +// GenService holds all Unsupported mock endpoints auth. +type GenService struct{} + +// ListAdminUsers +// List all users (admin only) +// Requires both API key AND bearer token with admin scope +func (s *GenService) ListAdminUsers(ctx context.Context, user *example.ExampleAuth) ([]User, error) { + return nil, errors.ErrUnsupported +} + +// QueryDataWithApiKey +// Query data with API key +// Accepts API key in header, query parameter, or cookie +func (s *GenService) QueryDataWithApiKey(ctx context.Context, user *example.ExampleAuth, query *string) error { + return errors.ErrUnsupported +} + +// ListDocuments +// List documents +// Requires basic authentication +func (s *GenService) ListDocuments(ctx context.Context, user *example.ExampleAuth) error { + return errors.ErrUnsupported +} + +// CreateDocument +// Create document +// Requires API key with bearer token +func (s *GenService) CreateDocument(ctx context.Context, user *example.ExampleAuth) error { + return errors.ErrUnsupported +} + +// GetDetailedProfile +// Get detailed profile +// Requires OpenID Connect authentication +func (s *GenService) GetDetailedProfile(ctx context.Context, user *example.ExampleAuth) error { + return errors.ErrUnsupported +} + +// GetProtectedResource +// Access protected resource +// Multiple authentication options: +// 1. OAuth2 with read scope, OR +// 2. API key (header) + Basic auth, OR +// 3. Bearer token + API +// key (cookie) +func (s *GenService) GetProtectedResource(ctx context.Context, user *example.ExampleAuth) error { + return errors.ErrUnsupported +} + +// GetPublicStatus +// Get API status +// Public endpoint that requires no authentication +func (s *GenService) GetPublicStatus(ctx context.Context) (*GetPublicStatusResponse, error) { + return nil, errors.ErrUnsupported +} + +// GetCurrentUser +// Get current user +// Requires either API key in header OR bearer token +func (s *GenService) GetCurrentUser(ctx context.Context, user *example.ExampleAuth) (*User, error) { + return nil, errors.ErrUnsupported +} + +// GetUserProfile +// Get user profile +// Requires bearer token authentication +func (s *GenService) GetUserProfile(ctx context.Context, user *example.ExampleAuth) (*User, error) { + return nil, errors.ErrUnsupported +} diff --git a/tests/go.mod b/tests/go.mod index edf51b1..f914233 100644 --- a/tests/go.mod +++ b/tests/go.mod @@ -1,11 +1,11 @@ module tests -go 1.24 +go 1.25.0 require ( github.com/bir/iken v0.8.10 github.com/google/uuid v1.6.0 - github.com/stretchr/testify v1.10.0 + github.com/stretchr/testify v1.11.1 ) require ( @@ -15,6 +15,6 @@ require ( github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect github.com/rs/zerolog v1.34.0 // indirect - golang.org/x/sys v0.35.0 // indirect + golang.org/x/sys v0.37.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/tests/go.sum b/tests/go.sum index 781ad6e..512c29c 100644 --- a/tests/go.sum +++ b/tests/go.sum @@ -22,11 +22,15 @@ github.com/rs/zerolog v1.34.0 h1:k43nTLIwcTVQAncfCw4KZ2VY6ukYoZaBPNOE8txlOeY= github.com/rs/zerolog v1.34.0/go.mod h1:bJsvje4Z08ROH4Nhs5iH600c3IkWhwp44iRc54W6wYQ= github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U= +github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.35.0 h1:vz1N37gP5bs89s7He8XuIYXpyY0+QlsKmzipCbUtyxI= golang.org/x/sys v0.35.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= +golang.org/x/sys v0.37.0 h1:fdNQudmxPjkdUTPnLn5mdQv7Zwvbvpaxqs831goi9kQ= +golang.org/x/sys v0.37.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= From d86dcd233f488cada23bf1c25294e95a6a7732cf Mon Sep 17 00:00:00 2001 From: Marc Bir Date: Mon, 20 Oct 2025 16:40:16 -0700 Subject: [PATCH 2/2] GHA updates --- .github/workflows/build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 39e67c8..2b7cec3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,12 +7,12 @@ jobs: build-test: strategy: matrix: - go-version: [ 1.24 ] + go-version: [ 1.25 ] os: [ ubuntu-latest ] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v4 - - uses: actions/setup-go@v5 + - uses: actions/checkout@v5 + - uses: actions/setup-go@v6 with: go-version: ${{ matrix.go-version }} @@ -29,4 +29,4 @@ jobs: with: files: ./coverage.txt - name: lint - uses: golangci/golangci-lint-action@v7 + uses: golangci/golangci-lint-action@v8