aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/github.com/go-openapi
diff options
context:
space:
mode:
author6543 <6543@obermui.de>2021-04-23 02:08:53 +0200
committerGitHub <noreply@github.com>2021-04-22 20:08:53 -0400
commit792b4dba2cc1b011e25f4a0c18fb648849cd885c (patch)
treefc5679ced43137a7b04ab1fb73dd2a4bd3ca9815 /vendor/github.com/go-openapi
parent834fc74873e8047552e9181e130bd53d8e890eb0 (diff)
downloadgitea-792b4dba2cc1b011e25f4a0c18fb648849cd885c.tar.gz
gitea-792b4dba2cc1b011e25f4a0c18fb648849cd885c.zip
[Vendor] Update directly used dependencys (#15593)
* update github.com/blevesearch/bleve v2.0.2 -> v2.0.3 * github.com/denisenkom/go-mssqldb v0.9.0 -> v0.10.0 * github.com/editorconfig/editorconfig-core-go v2.4.1 -> v2.4.2 * github.com/go-chi/cors v1.1.1 -> v1.2.0 * github.com/go-git/go-billy v5.0.0 -> v5.1.0 * github.com/go-git/go-git v5.2.0 -> v5.3.0 * github.com/go-ldap/ldap v3.2.4 -> v3.3.0 * github.com/go-redis/redis v8.6.0 -> v8.8.2 * github.com/go-sql-driver/mysql v1.5.0 -> v1.6.0 * github.com/go-swagger/go-swagger v0.26.1 -> v0.27.0 * github.com/lib/pq v1.9.0 -> v1.10.1 * github.com/mattn/go-sqlite3 v1.14.6 -> v1.14.7 * github.com/go-testfixtures/testfixtures v3.5.0 -> v3.6.0 * github.com/issue9/identicon v1.0.1 -> v1.2.0 * github.com/klauspost/compress v1.11.8 -> v1.12.1 * github.com/mgechev/revive v1.0.3 -> v1.0.6 * github.com/microcosm-cc/bluemonday v1.0.7 -> v1.0.8 * github.com/niklasfasching/go-org v1.4.0 -> v1.5.0 * github.com/olivere/elastic v7.0.22 -> v7.0.24 * github.com/pelletier/go-toml v1.8.1 -> v1.9.0 * github.com/prometheus/client_golang v1.9.0 -> v1.10.0 * github.com/xanzy/go-gitlab v0.44.0 -> v0.48.0 * github.com/yuin/goldmark v1.3.3 -> v1.3.5 * github.com/6543/go-version v1.2.4 -> v1.3.1 * do github.com/lib/pq v1.10.0 -> v1.10.1 again ...
Diffstat (limited to 'vendor/github.com/go-openapi')
-rw-r--r--vendor/github.com/go-openapi/runtime/.gitattributes1
-rw-r--r--vendor/github.com/go-openapi/runtime/.golangci.yml3
-rw-r--r--vendor/github.com/go-openapi/runtime/.travis.yml1
-rw-r--r--vendor/github.com/go-openapi/strfmt/README.md2
-rw-r--r--vendor/github.com/go-openapi/strfmt/format.go6
-rw-r--r--vendor/github.com/go-openapi/strfmt/go.mod3
-rw-r--r--vendor/github.com/go-openapi/strfmt/go.sum16
-rw-r--r--vendor/github.com/go-openapi/strfmt/ulid.go221
-rw-r--r--vendor/github.com/go-openapi/swag/.golangci.yml2
9 files changed, 246 insertions, 9 deletions
diff --git a/vendor/github.com/go-openapi/runtime/.gitattributes b/vendor/github.com/go-openapi/runtime/.gitattributes
new file mode 100644
index 0000000000..d207b1802b
--- /dev/null
+++ b/vendor/github.com/go-openapi/runtime/.gitattributes
@@ -0,0 +1 @@
+*.go text eol=lf
diff --git a/vendor/github.com/go-openapi/runtime/.golangci.yml b/vendor/github.com/go-openapi/runtime/.golangci.yml
index 71629d4ddd..90f38cf848 100644
--- a/vendor/github.com/go-openapi/runtime/.golangci.yml
+++ b/vendor/github.com/go-openapi/runtime/.golangci.yml
@@ -13,7 +13,6 @@ linters-settings:
min-len: 2
min-occurrences: 4
linters:
- enable-all: true
disable:
- maligned
- lll
@@ -40,3 +39,5 @@ linters:
- godot
- errorlint
- noctx
+ - interfacer
+ - nilerr
diff --git a/vendor/github.com/go-openapi/runtime/.travis.yml b/vendor/github.com/go-openapi/runtime/.travis.yml
index 78cdc892fa..a716f63e9b 100644
--- a/vendor/github.com/go-openapi/runtime/.travis.yml
+++ b/vendor/github.com/go-openapi/runtime/.travis.yml
@@ -1,7 +1,6 @@
after_success:
- bash <(curl -s https://codecov.io/bash)
go:
-- 1.14.x
- 1.x
install:
- GO111MODULE=off go get -u gotest.tools/gotestsum
diff --git a/vendor/github.com/go-openapi/strfmt/README.md b/vendor/github.com/go-openapi/strfmt/README.md
index b2645ce18a..0cf89d7766 100644
--- a/vendor/github.com/go-openapi/strfmt/README.md
+++ b/vendor/github.com/go-openapi/strfmt/README.md
@@ -38,6 +38,7 @@ It also provides convenient extensions to go-openapi users.
- ssn
- uuid, uuid3, uuid4, uuid5
- cidr (e.g. "192.0.2.1/24", "2001:db8:a0b:12f0::1/32")
+ - ulid (e.g. "00000PP9HGSBSSDZ1JTEXBJ0PW", [spec](https://github.com/ulid/spec))
> NOTE: as the name stands for, this package is intended to support string formatting only.
> It does not provide validation for numerical values with swagger format extension for JSON types "number" or
@@ -84,3 +85,4 @@ List of defined types:
- UUID3
- UUID4
- UUID5
+- [ULID](https://github.com/ulid/spec)
diff --git a/vendor/github.com/go-openapi/strfmt/format.go b/vendor/github.com/go-openapi/strfmt/format.go
index 3f93a72c86..13a1626fa4 100644
--- a/vendor/github.com/go-openapi/strfmt/format.go
+++ b/vendor/github.com/go-openapi/strfmt/format.go
@@ -160,6 +160,12 @@ func (f *defaultFormats) MapStructureHookFunc() mapstructure.DecodeHookFunc {
return Base64(data.(string)), nil
case "password":
return Password(data.(string)), nil
+ case "ulid":
+ ulid, err := ParseULID(data.(string))
+ if err != nil {
+ return nil, err
+ }
+ return ulid, nil
default:
return nil, errors.InvalidTypeName(v.Name)
}
diff --git a/vendor/github.com/go-openapi/strfmt/go.mod b/vendor/github.com/go-openapi/strfmt/go.mod
index 6eaa6d7b94..7a8faaeddc 100644
--- a/vendor/github.com/go-openapi/strfmt/go.mod
+++ b/vendor/github.com/go-openapi/strfmt/go.mod
@@ -5,8 +5,9 @@ require (
github.com/go-openapi/errors v0.19.8
github.com/google/uuid v1.1.1
github.com/mitchellh/mapstructure v1.3.3
+ github.com/oklog/ulid v1.3.1
github.com/stretchr/testify v1.6.1
- go.mongodb.org/mongo-driver v1.4.3
+ go.mongodb.org/mongo-driver v1.5.1
)
go 1.13
diff --git a/vendor/github.com/go-openapi/strfmt/go.sum b/vendor/github.com/go-openapi/strfmt/go.sum
index a2d360321b..ad311635d5 100644
--- a/vendor/github.com/go-openapi/strfmt/go.sum
+++ b/vendor/github.com/go-openapi/strfmt/go.sum
@@ -63,6 +63,8 @@ github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RR
github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
+github.com/oklog/ulid v1.3.1 h1:EGfNDEx6MqHz8B3uNV6QAib1UR2Lm97sHi3ocA6ESJ4=
+github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U=
github.com/pelletier/go-toml v1.7.0/go.mod h1:vwGMzjaWMwyfHwgIBhI2YUM4fB6nL6lVAvS1LBMMhTE=
github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
@@ -86,14 +88,16 @@ github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4=
github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk=
-github.com/xdg/scram v0.0.0-20180814205039-7eeb5667e42c/go.mod h1:lB8K/P019DLNhemzwFU4jHLhdvlE6uDZjXFejJXr49I=
-github.com/xdg/stringprep v0.0.0-20180714160509-73f8eece6fdc/go.mod h1:Jhud4/sHMO4oL310DaZAKk9ZaJ08SJfe+sJh0HrGL1Y=
-go.mongodb.org/mongo-driver v1.4.3 h1:moga+uhicpVshTyaqY9L23E6QqwcHRUv1sqyOsoyOO8=
-go.mongodb.org/mongo-driver v1.4.3/go.mod h1:WcMNYLx/IlOxLe6JRJiv2uXuCz6zBLndR4SoGjYphSc=
+github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI=
+github.com/xdg-go/scram v1.0.2/go.mod h1:1WAq6h33pAW+iRreB34OORO2Nf7qel3VV3fjBj+hCSs=
+github.com/xdg-go/stringprep v1.0.2/go.mod h1:8F9zXuvzgwmyT5DUm4GUfZGDdT3W+LCvS6+da4O5kxM=
+github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d/go.mod h1:rHwXgn7JulP+udvsHwJoVG1YGAP6VLg4y9I5dyZdqmA=
+go.mongodb.org/mongo-driver v1.5.1 h1:9nOVLGDfOaZ9R0tBumx/BcuqkbFpyTCU2r/Po7A2azI=
+go.mongodb.org/mongo-driver v1.5.1/go.mod h1:gRXCHX4Jo7J0IJ1oDQyUxF7jfy19UfxniMS4xxMmUqw=
golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190422162423-af44ce270edf/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE=
-golang.org/x/crypto v0.0.0-20190530122614-20be4c3c3ed5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
+golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
@@ -109,7 +113,7 @@ golang.org/x/sys v0.0.0-20190419153524-e8e3143a4f4a/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190531175056-4c3a928424d2/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
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.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20190329151228-23e29df326fe/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190416151739-9c9e1878f421/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
diff --git a/vendor/github.com/go-openapi/strfmt/ulid.go b/vendor/github.com/go-openapi/strfmt/ulid.go
new file mode 100644
index 0000000000..6ea2e35c36
--- /dev/null
+++ b/vendor/github.com/go-openapi/strfmt/ulid.go
@@ -0,0 +1,221 @@
+package strfmt
+
+import (
+ cryptorand "crypto/rand"
+ "database/sql/driver"
+ "encoding/json"
+ "errors"
+ "fmt"
+ "io"
+ "sync"
+
+ "github.com/oklog/ulid"
+ "go.mongodb.org/mongo-driver/bson"
+)
+
+// ULID represents a ulid string format
+// ref:
+// https://github.com/ulid/spec
+// impl:
+// https://github.com/oklog/ulid
+//
+// swagger:strfmt ulid
+type ULID struct {
+ ulid.ULID
+}
+
+var (
+ ulidEntropyPool = sync.Pool{
+ New: func() interface{} {
+ return cryptorand.Reader
+ },
+ }
+
+ ULIDScanDefaultFunc = func(raw interface{}) (ULID, error) {
+ var u ULID = NewULIDZero()
+ switch x := raw.(type) {
+ case nil:
+ // zerp ulid
+ return u, nil
+ case string:
+ if x == "" {
+ // zero ulid
+ return u, nil
+ }
+ return u, u.UnmarshalText([]byte(x))
+ case []byte:
+ return u, u.UnmarshalText(x)
+ }
+
+ return u, fmt.Errorf("cannot sql.Scan() strfmt.ULID from: %#v: %w", raw, ulid.ErrScanValue)
+ }
+
+ // ULIDScanOverrideFunc allows you to override the Scan method of the ULID type
+ ULIDScanOverrideFunc = ULIDScanDefaultFunc
+
+ ULIDValueDefaultFunc = func(u ULID) (driver.Value, error) {
+ return driver.Value(u.String()), nil
+ }
+
+ // ULIDValueOverrideFunc allows you to override the Value method of the ULID type
+ ULIDValueOverrideFunc = ULIDValueDefaultFunc
+)
+
+func init() {
+ // register formats in the default registry:
+ // - ulid
+ ulid := ULID{}
+ Default.Add("ulid", &ulid, IsULID)
+}
+
+// IsULID checks if provided string is ULID format
+// Be noticed that this function considers overflowed ULID as non-ulid.
+// For more details see https://github.com/ulid/spec
+func IsULID(str string) bool {
+ _, err := ulid.ParseStrict(str)
+ return err == nil
+}
+
+// ParseULID parses a string that represents an valid ULID
+func ParseULID(str string) (ULID, error) {
+ var u ULID
+
+ return u, u.UnmarshalText([]byte(str))
+}
+
+// NewULIDZero returns a zero valued ULID type
+func NewULIDZero() ULID {
+ return ULID{}
+}
+
+// NewULID generates new unique ULID value and a error if any
+func NewULID() (u ULID, err error) {
+ entropy := ulidEntropyPool.Get().(io.Reader)
+
+ id, err := ulid.New(ulid.Now(), entropy)
+ if err != nil {
+ return u, err
+ }
+ ulidEntropyPool.Put(entropy)
+
+ u.ULID = id
+ return u, nil
+}
+
+// GetULID returns underlying instance of ULID
+func (u *ULID) GetULID() interface{} {
+ return u.ULID
+}
+
+// MarshalText returns this instance into text
+func (u ULID) MarshalText() ([]byte, error) {
+ return u.ULID.MarshalText()
+}
+
+// UnmarshalText hydrates this instance from text
+func (u *ULID) UnmarshalText(data []byte) error { // validation is performed later on
+ return u.ULID.UnmarshalText(data)
+}
+
+// Scan reads a value from a database driver
+func (u *ULID) Scan(raw interface{}) error {
+ ul, err := ULIDScanOverrideFunc(raw)
+ if err == nil {
+ *u = ul
+ }
+ return err
+}
+
+// Value converts a value to a database driver value
+func (u ULID) Value() (driver.Value, error) {
+ return ULIDValueOverrideFunc(u)
+}
+
+func (u ULID) String() string {
+ return u.ULID.String()
+}
+
+// MarshalJSON returns the ULID as JSON
+func (u ULID) MarshalJSON() ([]byte, error) {
+ return json.Marshal(u.String())
+}
+
+// UnmarshalJSON sets the ULID from JSON
+func (u *ULID) UnmarshalJSON(data []byte) error {
+ if string(data) == jsonNull {
+ return nil
+ }
+ var ustr string
+ if err := json.Unmarshal(data, &ustr); err != nil {
+ return err
+ }
+ id, err := ulid.ParseStrict(ustr)
+ if err != nil {
+ return fmt.Errorf("couldn't parse JSON value as ULID: %w", err)
+ }
+ u.ULID = id
+ return nil
+}
+
+// MarshalBSON document from this value
+func (u ULID) MarshalBSON() ([]byte, error) {
+ return bson.Marshal(bson.M{"data": u.String()})
+}
+
+// UnmarshalBSON document into this value
+func (u *ULID) UnmarshalBSON(data []byte) error {
+ var m bson.M
+ if err := bson.Unmarshal(data, &m); err != nil {
+ return err
+ }
+
+ if ud, ok := m["data"].(string); ok {
+ id, err := ulid.ParseStrict(ud)
+ if err != nil {
+ return fmt.Errorf("couldn't parse bson bytes as ULID: %w", err)
+ }
+ u.ULID = id
+ return nil
+ }
+ return errors.New("couldn't unmarshal bson bytes as ULID")
+}
+
+// DeepCopyInto copies the receiver and writes its value into out.
+func (u *ULID) DeepCopyInto(out *ULID) {
+ *out = *u
+}
+
+// DeepCopy copies the receiver into a new ULID.
+func (u *ULID) DeepCopy() *ULID {
+ if u == nil {
+ return nil
+ }
+ out := new(ULID)
+ u.DeepCopyInto(out)
+ return out
+}
+
+// GobEncode implements the gob.GobEncoder interface.
+func (u ULID) GobEncode() ([]byte, error) {
+ return u.ULID.MarshalBinary()
+}
+
+// GobDecode implements the gob.GobDecoder interface.
+func (u *ULID) GobDecode(data []byte) error {
+ return u.ULID.UnmarshalBinary(data)
+}
+
+// MarshalBinary implements the encoding.BinaryMarshaler interface.
+func (u ULID) MarshalBinary() ([]byte, error) {
+ return u.ULID.MarshalBinary()
+}
+
+// UnmarshalBinary implements the encoding.BinaryUnmarshaler interface.
+func (u *ULID) UnmarshalBinary(data []byte) error {
+ return u.ULID.UnmarshalBinary(data)
+}
+
+// Equal checks if two ULID instances are equal by their underlying type
+func (u ULID) Equal(other ULID) bool {
+ return u.ULID == other.ULID
+}
diff --git a/vendor/github.com/go-openapi/swag/.golangci.yml b/vendor/github.com/go-openapi/swag/.golangci.yml
index 813c47aa64..842ac1c095 100644
--- a/vendor/github.com/go-openapi/swag/.golangci.yml
+++ b/vendor/github.com/go-openapi/swag/.golangci.yml
@@ -37,3 +37,5 @@ linters:
- gci
- gocognit
- paralleltest
+ - thelper
+ - ifshort