mirror of
https://github.com/ergochat/ergo.git
synced 2024-11-30 07:59:24 +01:00
commit
8692ede1f3
8
go.mod
8
go.mod
@ -3,9 +3,9 @@ module github.com/oragono/oragono
|
|||||||
go 1.14
|
go 1.14
|
||||||
|
|
||||||
require (
|
require (
|
||||||
code.cloudfoundry.org/bytefmt v0.0.0-20190819182555-854d396b647c
|
code.cloudfoundry.org/bytefmt v0.0.0-20200131002437-cf55d5288a48
|
||||||
github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815
|
github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815
|
||||||
github.com/go-ldap/ldap/v3 v3.1.6
|
github.com/go-ldap/ldap/v3 v3.1.7
|
||||||
github.com/go-sql-driver/mysql v1.5.0
|
github.com/go-sql-driver/mysql v1.5.0
|
||||||
github.com/goshuirc/e-nfa v0.0.0-20160917075329-7071788e3940 // indirect
|
github.com/goshuirc/e-nfa v0.0.0-20160917075329-7071788e3940 // indirect
|
||||||
github.com/goshuirc/irc-go v0.0.0-20190713001546-05ecc95249a0
|
github.com/goshuirc/irc-go v0.0.0-20190713001546-05ecc95249a0
|
||||||
@ -18,7 +18,7 @@ require (
|
|||||||
github.com/oragono/go-ident v0.0.0-20170110123031-337fed0fd21a
|
github.com/oragono/go-ident v0.0.0-20170110123031-337fed0fd21a
|
||||||
github.com/stretchr/testify v1.4.0 // indirect
|
github.com/stretchr/testify v1.4.0 // indirect
|
||||||
github.com/tidwall/buntdb v1.1.2
|
github.com/tidwall/buntdb v1.1.2
|
||||||
golang.org/x/crypto v0.0.0-20191112222119-e1110fd1c708
|
golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073
|
||||||
golang.org/x/text v0.3.2
|
golang.org/x/text v0.3.2
|
||||||
gopkg.in/yaml.v2 v2.2.5
|
gopkg.in/yaml.v2 v2.2.8
|
||||||
)
|
)
|
||||||
|
8
go.sum
8
go.sum
@ -1,5 +1,7 @@
|
|||||||
code.cloudfoundry.org/bytefmt v0.0.0-20190819182555-854d396b647c h1:2RuXx1+tSNWRjxhY0Bx52kjV2odJQ0a6MTbfTPhGAkg=
|
code.cloudfoundry.org/bytefmt v0.0.0-20190819182555-854d396b647c h1:2RuXx1+tSNWRjxhY0Bx52kjV2odJQ0a6MTbfTPhGAkg=
|
||||||
code.cloudfoundry.org/bytefmt v0.0.0-20190819182555-854d396b647c/go.mod h1:wN/zk7mhREp/oviagqUXY3EwuHhWyOvAdsn5Y4CzOrc=
|
code.cloudfoundry.org/bytefmt v0.0.0-20190819182555-854d396b647c/go.mod h1:wN/zk7mhREp/oviagqUXY3EwuHhWyOvAdsn5Y4CzOrc=
|
||||||
|
code.cloudfoundry.org/bytefmt v0.0.0-20200131002437-cf55d5288a48 h1:/EMHruHCFXR9xClkGV/t0rmHrdhX4+trQUcBqjwc9xE=
|
||||||
|
code.cloudfoundry.org/bytefmt v0.0.0-20200131002437-cf55d5288a48/go.mod h1:wN/zk7mhREp/oviagqUXY3EwuHhWyOvAdsn5Y4CzOrc=
|
||||||
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
|
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
|
||||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||||
github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815 h1:bWDMxwH3px2JBh6AyO7hdCn/PkvCZXii8TGj7sbtEbQ=
|
github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815 h1:bWDMxwH3px2JBh6AyO7hdCn/PkvCZXii8TGj7sbtEbQ=
|
||||||
@ -10,6 +12,8 @@ github.com/go-asn1-ber/asn1-ber v1.3.1 h1:gvPdv/Hr++TRFCl0UbPFHC54P9N9jgsRPnmnr4
|
|||||||
github.com/go-asn1-ber/asn1-ber v1.3.1/go.mod h1:hEBeB/ic+5LoWskz+yKT7vGhhPYkProFKoKdwZRWMe0=
|
github.com/go-asn1-ber/asn1-ber v1.3.1/go.mod h1:hEBeB/ic+5LoWskz+yKT7vGhhPYkProFKoKdwZRWMe0=
|
||||||
github.com/go-ldap/ldap/v3 v3.1.6 h1:VTihvB7egSAvU6KOagaiA/EvgJMR2jsjRAVIho2ydBo=
|
github.com/go-ldap/ldap/v3 v3.1.6 h1:VTihvB7egSAvU6KOagaiA/EvgJMR2jsjRAVIho2ydBo=
|
||||||
github.com/go-ldap/ldap/v3 v3.1.6/go.mod h1:5Zun81jBTabRaI8lzN7E1JjyEl1g6zI6u9pd8luAK4Q=
|
github.com/go-ldap/ldap/v3 v3.1.6/go.mod h1:5Zun81jBTabRaI8lzN7E1JjyEl1g6zI6u9pd8luAK4Q=
|
||||||
|
github.com/go-ldap/ldap/v3 v3.1.7 h1:aHjuWTgZsnxjMgqzx0JHwNqz4jBYZTcNarbPFkW1Oww=
|
||||||
|
github.com/go-ldap/ldap/v3 v3.1.7/go.mod h1:5Zun81jBTabRaI8lzN7E1JjyEl1g6zI6u9pd8luAK4Q=
|
||||||
github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs=
|
github.com/go-sql-driver/mysql v1.5.0 h1:ozyZYNQW3x3HtqT1jira07DN2PArx2v7/mN66gGcHOs=
|
||||||
github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
|
github.com/go-sql-driver/mysql v1.5.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
|
||||||
github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM=
|
github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM=
|
||||||
@ -61,6 +65,8 @@ github.com/tidwall/tinyqueue v0.0.0-20180302190814-1e39f5511563/go.mod h1:mLqSmt
|
|||||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||||
golang.org/x/crypto v0.0.0-20191112222119-e1110fd1c708 h1:pXVtWnwHkrWD9ru3sDxY/qFK/bfc0egRovX91EjWjf4=
|
golang.org/x/crypto v0.0.0-20191112222119-e1110fd1c708 h1:pXVtWnwHkrWD9ru3sDxY/qFK/bfc0egRovX91EjWjf4=
|
||||||
golang.org/x/crypto v0.0.0-20191112222119-e1110fd1c708/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
golang.org/x/crypto v0.0.0-20191112222119-e1110fd1c708/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||||
|
golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073 h1:xMPOj6Pz6UipU1wXLkrtqpHbR0AVFnyPEQq/wRWz9lM=
|
||||||
|
golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||||
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3 h1:0GoQqolDA55aaLxZyTzK/Y2ePZzZTUrRacwib7cNsYQ=
|
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3 h1:0GoQqolDA55aaLxZyTzK/Y2ePZzZTUrRacwib7cNsYQ=
|
||||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||||
@ -89,3 +95,5 @@ 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.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
gopkg.in/yaml.v2 v2.2.5 h1:ymVxjfMaHvXD8RqPRmzHHsB3VvucivSkIAvJFDI5O3c=
|
gopkg.in/yaml.v2 v2.2.5 h1:ymVxjfMaHvXD8RqPRmzHHsB3VvucivSkIAvJFDI5O3c=
|
||||||
gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
|
gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10=
|
||||||
|
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
|
4
vendor/code.cloudfoundry.org/bytefmt/README.md
generated
vendored
4
vendor/code.cloudfoundry.org/bytefmt/README.md
generated
vendored
@ -13,3 +13,7 @@ bytefmt.ByteSize(uint64(1024)) // returns "1K"
|
|||||||
```
|
```
|
||||||
|
|
||||||
For documentation, please see http://godoc.org/code.cloudfoundry.org/bytefmt
|
For documentation, please see http://godoc.org/code.cloudfoundry.org/bytefmt
|
||||||
|
|
||||||
|
## Reporting issues and requesting features
|
||||||
|
|
||||||
|
Please report all issues and feature requests in [cloudfoundry/diego-release](https://github.com/cloudfoundry/diego-release/issues).
|
||||||
|
17
vendor/github.com/go-ldap/ldap/v3/ldap.go
generated
vendored
17
vendor/github.com/go-ldap/ldap/v3/ldap.go
generated
vendored
@ -269,13 +269,18 @@ func addRequestDescriptions(packet *ber.Packet) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func addDefaultLDAPResponseDescriptions(packet *ber.Packet) error {
|
func addDefaultLDAPResponseDescriptions(packet *ber.Packet) error {
|
||||||
err := GetLDAPError(packet)
|
resultCode := uint16(LDAPResultSuccess)
|
||||||
if err == nil {
|
matchedDN := ""
|
||||||
return nil
|
description := "Success"
|
||||||
|
if err := GetLDAPError(packet); err != nil {
|
||||||
|
resultCode = err.(*Error).ResultCode
|
||||||
|
matchedDN = err.(*Error).MatchedDN
|
||||||
|
description = "Error Message"
|
||||||
}
|
}
|
||||||
packet.Children[1].Children[0].Description = "Result Code (" + LDAPResultCodeMap[err.(*Error).ResultCode] + ")"
|
|
||||||
packet.Children[1].Children[1].Description = "Matched DN (" + err.(*Error).MatchedDN + ")"
|
packet.Children[1].Children[0].Description = "Result Code (" + LDAPResultCodeMap[resultCode] + ")"
|
||||||
packet.Children[1].Children[2].Description = "Error Message"
|
packet.Children[1].Children[1].Description = "Matched DN (" + matchedDN + ")"
|
||||||
|
packet.Children[1].Children[2].Description = description
|
||||||
if len(packet.Children[1].Children) > 3 {
|
if len(packet.Children[1].Children) > 3 {
|
||||||
packet.Children[1].Children[3].Description = "Referral"
|
packet.Children[1].Children[3].Description = "Referral"
|
||||||
}
|
}
|
||||||
|
2
vendor/golang.org/x/crypto/sha3/sha3_s390x.go
generated
vendored
2
vendor/golang.org/x/crypto/sha3/sha3_s390x.go
generated
vendored
@ -112,7 +112,7 @@ func (s *asmState) Write(b []byte) (int, error) {
|
|||||||
if len(s.buf) == 0 && len(b) >= cap(s.buf) {
|
if len(s.buf) == 0 && len(b) >= cap(s.buf) {
|
||||||
// Hash the data directly and push any remaining bytes
|
// Hash the data directly and push any remaining bytes
|
||||||
// into the buffer.
|
// into the buffer.
|
||||||
remainder := len(s.buf) % s.rate
|
remainder := len(b) % s.rate
|
||||||
kimd(s.function, &s.a, b[:len(b)-remainder])
|
kimd(s.function, &s.a, b[:len(b)-remainder])
|
||||||
if remainder != 0 {
|
if remainder != 0 {
|
||||||
s.copyIntoBuf(b[len(b)-remainder:])
|
s.copyIntoBuf(b[len(b)-remainder:])
|
||||||
|
17
vendor/golang.org/x/crypto/ssh/terminal/terminal.go
generated
vendored
17
vendor/golang.org/x/crypto/ssh/terminal/terminal.go
generated
vendored
@ -7,6 +7,7 @@ package terminal
|
|||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"io"
|
"io"
|
||||||
|
"runtime"
|
||||||
"strconv"
|
"strconv"
|
||||||
"sync"
|
"sync"
|
||||||
"unicode/utf8"
|
"unicode/utf8"
|
||||||
@ -939,6 +940,8 @@ func (s *stRingBuffer) NthPreviousEntry(n int) (value string, ok bool) {
|
|||||||
// readPasswordLine reads from reader until it finds \n or io.EOF.
|
// readPasswordLine reads from reader until it finds \n or io.EOF.
|
||||||
// The slice returned does not include the \n.
|
// The slice returned does not include the \n.
|
||||||
// readPasswordLine also ignores any \r it finds.
|
// readPasswordLine also ignores any \r it finds.
|
||||||
|
// Windows uses \r as end of line. So, on Windows, readPasswordLine
|
||||||
|
// reads until it finds \r and ignores any \n it finds during processing.
|
||||||
func readPasswordLine(reader io.Reader) ([]byte, error) {
|
func readPasswordLine(reader io.Reader) ([]byte, error) {
|
||||||
var buf [1]byte
|
var buf [1]byte
|
||||||
var ret []byte
|
var ret []byte
|
||||||
@ -947,10 +950,20 @@ func readPasswordLine(reader io.Reader) ([]byte, error) {
|
|||||||
n, err := reader.Read(buf[:])
|
n, err := reader.Read(buf[:])
|
||||||
if n > 0 {
|
if n > 0 {
|
||||||
switch buf[0] {
|
switch buf[0] {
|
||||||
|
case '\b':
|
||||||
|
if len(ret) > 0 {
|
||||||
|
ret = ret[:len(ret)-1]
|
||||||
|
}
|
||||||
case '\n':
|
case '\n':
|
||||||
return ret, nil
|
if runtime.GOOS != "windows" {
|
||||||
|
return ret, nil
|
||||||
|
}
|
||||||
|
// otherwise ignore \n
|
||||||
case '\r':
|
case '\r':
|
||||||
// remove \r from passwords on Windows
|
if runtime.GOOS == "windows" {
|
||||||
|
return ret, nil
|
||||||
|
}
|
||||||
|
// otherwise ignore \r
|
||||||
default:
|
default:
|
||||||
ret = append(ret, buf[0])
|
ret = append(ret, buf[0])
|
||||||
}
|
}
|
||||||
|
4
vendor/golang.org/x/crypto/ssh/terminal/util_windows.go
generated
vendored
4
vendor/golang.org/x/crypto/ssh/terminal/util_windows.go
generated
vendored
@ -85,8 +85,8 @@ func ReadPassword(fd int) ([]byte, error) {
|
|||||||
}
|
}
|
||||||
old := st
|
old := st
|
||||||
|
|
||||||
st &^= (windows.ENABLE_ECHO_INPUT)
|
st &^= (windows.ENABLE_ECHO_INPUT | windows.ENABLE_LINE_INPUT)
|
||||||
st |= (windows.ENABLE_PROCESSED_INPUT | windows.ENABLE_LINE_INPUT | windows.ENABLE_PROCESSED_OUTPUT)
|
st |= (windows.ENABLE_PROCESSED_OUTPUT | windows.ENABLE_PROCESSED_INPUT)
|
||||||
if err := windows.SetConsoleMode(windows.Handle(fd), st); err != nil {
|
if err := windows.SetConsoleMode(windows.Handle(fd), st); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
18
vendor/gopkg.in/yaml.v2/.travis.yml
generated
vendored
18
vendor/gopkg.in/yaml.v2/.travis.yml
generated
vendored
@ -1,12 +1,16 @@
|
|||||||
language: go
|
language: go
|
||||||
|
|
||||||
go:
|
go:
|
||||||
- 1.4
|
- "1.4.x"
|
||||||
- 1.5
|
- "1.5.x"
|
||||||
- 1.6
|
- "1.6.x"
|
||||||
- 1.7
|
- "1.7.x"
|
||||||
- 1.8
|
- "1.8.x"
|
||||||
- 1.9
|
- "1.9.x"
|
||||||
- tip
|
- "1.10.x"
|
||||||
|
- "1.11.x"
|
||||||
|
- "1.12.x"
|
||||||
|
- "1.13.x"
|
||||||
|
- "tip"
|
||||||
|
|
||||||
go_import_path: gopkg.in/yaml.v2
|
go_import_path: gopkg.in/yaml.v2
|
||||||
|
109
vendor/gopkg.in/yaml.v2/scannerc.go
generated
vendored
109
vendor/gopkg.in/yaml.v2/scannerc.go
generated
vendored
@ -626,30 +626,17 @@ func trace(args ...interface{}) func() {
|
|||||||
func yaml_parser_fetch_more_tokens(parser *yaml_parser_t) bool {
|
func yaml_parser_fetch_more_tokens(parser *yaml_parser_t) bool {
|
||||||
// While we need more tokens to fetch, do it.
|
// While we need more tokens to fetch, do it.
|
||||||
for {
|
for {
|
||||||
// Check if we really need to fetch more tokens.
|
if parser.tokens_head != len(parser.tokens) {
|
||||||
need_more_tokens := false
|
// If queue is non-empty, check if any potential simple key may
|
||||||
|
// occupy the head position.
|
||||||
if parser.tokens_head == len(parser.tokens) {
|
head_tok_idx, ok := parser.simple_keys_by_tok[parser.tokens_parsed]
|
||||||
// Queue is empty.
|
if !ok {
|
||||||
need_more_tokens = true
|
break
|
||||||
} else {
|
} else if valid, ok := yaml_simple_key_is_valid(parser, &parser.simple_keys[head_tok_idx]); !ok {
|
||||||
// Check if any potential simple key may occupy the head position.
|
|
||||||
if !yaml_parser_stale_simple_keys(parser) {
|
|
||||||
return false
|
return false
|
||||||
|
} else if !valid {
|
||||||
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
for i := range parser.simple_keys {
|
|
||||||
simple_key := &parser.simple_keys[i]
|
|
||||||
if simple_key.possible && simple_key.token_number == parser.tokens_parsed {
|
|
||||||
need_more_tokens = true
|
|
||||||
break
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// We are finished.
|
|
||||||
if !need_more_tokens {
|
|
||||||
break
|
|
||||||
}
|
}
|
||||||
// Fetch the next token.
|
// Fetch the next token.
|
||||||
if !yaml_parser_fetch_next_token(parser) {
|
if !yaml_parser_fetch_next_token(parser) {
|
||||||
@ -678,11 +665,6 @@ func yaml_parser_fetch_next_token(parser *yaml_parser_t) bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
// Remove obsolete potential simple keys.
|
|
||||||
if !yaml_parser_stale_simple_keys(parser) {
|
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check the indentation level against the current column.
|
// Check the indentation level against the current column.
|
||||||
if !yaml_parser_unroll_indent(parser, parser.mark.column) {
|
if !yaml_parser_unroll_indent(parser, parser.mark.column) {
|
||||||
return false
|
return false
|
||||||
@ -837,29 +819,30 @@ func yaml_parser_fetch_next_token(parser *yaml_parser_t) bool {
|
|||||||
"found character that cannot start any token")
|
"found character that cannot start any token")
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check the list of potential simple keys and remove the positions that
|
func yaml_simple_key_is_valid(parser *yaml_parser_t, simple_key *yaml_simple_key_t) (valid, ok bool) {
|
||||||
// cannot contain simple keys anymore.
|
if !simple_key.possible {
|
||||||
func yaml_parser_stale_simple_keys(parser *yaml_parser_t) bool {
|
return false, true
|
||||||
// Check for a potential simple key for each flow level.
|
|
||||||
for i := range parser.simple_keys {
|
|
||||||
simple_key := &parser.simple_keys[i]
|
|
||||||
|
|
||||||
// The specification requires that a simple key
|
|
||||||
//
|
|
||||||
// - is limited to a single line,
|
|
||||||
// - is shorter than 1024 characters.
|
|
||||||
if simple_key.possible && (simple_key.mark.line < parser.mark.line || simple_key.mark.index+1024 < parser.mark.index) {
|
|
||||||
|
|
||||||
// Check if the potential simple key to be removed is required.
|
|
||||||
if simple_key.required {
|
|
||||||
return yaml_parser_set_scanner_error(parser,
|
|
||||||
"while scanning a simple key", simple_key.mark,
|
|
||||||
"could not find expected ':'")
|
|
||||||
}
|
|
||||||
simple_key.possible = false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return true
|
|
||||||
|
// The 1.2 specification says:
|
||||||
|
//
|
||||||
|
// "If the ? indicator is omitted, parsing needs to see past the
|
||||||
|
// implicit key to recognize it as such. To limit the amount of
|
||||||
|
// lookahead required, the “:” indicator must appear at most 1024
|
||||||
|
// Unicode characters beyond the start of the key. In addition, the key
|
||||||
|
// is restricted to a single line."
|
||||||
|
//
|
||||||
|
if simple_key.mark.line < parser.mark.line || simple_key.mark.index+1024 < parser.mark.index {
|
||||||
|
// Check if the potential simple key to be removed is required.
|
||||||
|
if simple_key.required {
|
||||||
|
return false, yaml_parser_set_scanner_error(parser,
|
||||||
|
"while scanning a simple key", simple_key.mark,
|
||||||
|
"could not find expected ':'")
|
||||||
|
}
|
||||||
|
simple_key.possible = false
|
||||||
|
return false, true
|
||||||
|
}
|
||||||
|
return true, true
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if a simple key may start at the current position and add it if
|
// Check if a simple key may start at the current position and add it if
|
||||||
@ -879,13 +862,14 @@ func yaml_parser_save_simple_key(parser *yaml_parser_t) bool {
|
|||||||
possible: true,
|
possible: true,
|
||||||
required: required,
|
required: required,
|
||||||
token_number: parser.tokens_parsed + (len(parser.tokens) - parser.tokens_head),
|
token_number: parser.tokens_parsed + (len(parser.tokens) - parser.tokens_head),
|
||||||
|
mark: parser.mark,
|
||||||
}
|
}
|
||||||
simple_key.mark = parser.mark
|
|
||||||
|
|
||||||
if !yaml_parser_remove_simple_key(parser) {
|
if !yaml_parser_remove_simple_key(parser) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
parser.simple_keys[len(parser.simple_keys)-1] = simple_key
|
parser.simple_keys[len(parser.simple_keys)-1] = simple_key
|
||||||
|
parser.simple_keys_by_tok[simple_key.token_number] = len(parser.simple_keys) - 1
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
@ -900,9 +884,10 @@ func yaml_parser_remove_simple_key(parser *yaml_parser_t) bool {
|
|||||||
"while scanning a simple key", parser.simple_keys[i].mark,
|
"while scanning a simple key", parser.simple_keys[i].mark,
|
||||||
"could not find expected ':'")
|
"could not find expected ':'")
|
||||||
}
|
}
|
||||||
|
// Remove the key from the stack.
|
||||||
|
parser.simple_keys[i].possible = false
|
||||||
|
delete(parser.simple_keys_by_tok, parser.simple_keys[i].token_number)
|
||||||
}
|
}
|
||||||
// Remove the key from the stack.
|
|
||||||
parser.simple_keys[i].possible = false
|
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -912,7 +897,12 @@ const max_flow_level = 10000
|
|||||||
// Increase the flow level and resize the simple key list if needed.
|
// Increase the flow level and resize the simple key list if needed.
|
||||||
func yaml_parser_increase_flow_level(parser *yaml_parser_t) bool {
|
func yaml_parser_increase_flow_level(parser *yaml_parser_t) bool {
|
||||||
// Reset the simple key on the next level.
|
// Reset the simple key on the next level.
|
||||||
parser.simple_keys = append(parser.simple_keys, yaml_simple_key_t{})
|
parser.simple_keys = append(parser.simple_keys, yaml_simple_key_t{
|
||||||
|
possible: false,
|
||||||
|
required: false,
|
||||||
|
token_number: parser.tokens_parsed + (len(parser.tokens) - parser.tokens_head),
|
||||||
|
mark: parser.mark,
|
||||||
|
})
|
||||||
|
|
||||||
// Increase the flow level.
|
// Increase the flow level.
|
||||||
parser.flow_level++
|
parser.flow_level++
|
||||||
@ -928,7 +918,9 @@ func yaml_parser_increase_flow_level(parser *yaml_parser_t) bool {
|
|||||||
func yaml_parser_decrease_flow_level(parser *yaml_parser_t) bool {
|
func yaml_parser_decrease_flow_level(parser *yaml_parser_t) bool {
|
||||||
if parser.flow_level > 0 {
|
if parser.flow_level > 0 {
|
||||||
parser.flow_level--
|
parser.flow_level--
|
||||||
parser.simple_keys = parser.simple_keys[:len(parser.simple_keys)-1]
|
last := len(parser.simple_keys) - 1
|
||||||
|
delete(parser.simple_keys_by_tok, parser.simple_keys[last].token_number)
|
||||||
|
parser.simple_keys = parser.simple_keys[:last]
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
@ -1005,6 +997,8 @@ func yaml_parser_fetch_stream_start(parser *yaml_parser_t) bool {
|
|||||||
// Initialize the simple key stack.
|
// Initialize the simple key stack.
|
||||||
parser.simple_keys = append(parser.simple_keys, yaml_simple_key_t{})
|
parser.simple_keys = append(parser.simple_keys, yaml_simple_key_t{})
|
||||||
|
|
||||||
|
parser.simple_keys_by_tok = make(map[int]int)
|
||||||
|
|
||||||
// A simple key is allowed at the beginning of the stream.
|
// A simple key is allowed at the beginning of the stream.
|
||||||
parser.simple_key_allowed = true
|
parser.simple_key_allowed = true
|
||||||
|
|
||||||
@ -1286,7 +1280,11 @@ func yaml_parser_fetch_value(parser *yaml_parser_t) bool {
|
|||||||
simple_key := &parser.simple_keys[len(parser.simple_keys)-1]
|
simple_key := &parser.simple_keys[len(parser.simple_keys)-1]
|
||||||
|
|
||||||
// Have we found a simple key?
|
// Have we found a simple key?
|
||||||
if simple_key.possible {
|
if valid, ok := yaml_simple_key_is_valid(parser, simple_key); !ok {
|
||||||
|
return false
|
||||||
|
|
||||||
|
} else if valid {
|
||||||
|
|
||||||
// Create the KEY token and insert it into the queue.
|
// Create the KEY token and insert it into the queue.
|
||||||
token := yaml_token_t{
|
token := yaml_token_t{
|
||||||
typ: yaml_KEY_TOKEN,
|
typ: yaml_KEY_TOKEN,
|
||||||
@ -1304,6 +1302,7 @@ func yaml_parser_fetch_value(parser *yaml_parser_t) bool {
|
|||||||
|
|
||||||
// Remove the simple key.
|
// Remove the simple key.
|
||||||
simple_key.possible = false
|
simple_key.possible = false
|
||||||
|
delete(parser.simple_keys_by_tok, simple_key.token_number)
|
||||||
|
|
||||||
// A simple key cannot follow another simple key.
|
// A simple key cannot follow another simple key.
|
||||||
parser.simple_key_allowed = false
|
parser.simple_key_allowed = false
|
||||||
|
2
vendor/gopkg.in/yaml.v2/yaml.go
generated
vendored
2
vendor/gopkg.in/yaml.v2/yaml.go
generated
vendored
@ -89,7 +89,7 @@ func UnmarshalStrict(in []byte, out interface{}) (err error) {
|
|||||||
return unmarshal(in, out, true)
|
return unmarshal(in, out, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
// A Decorder reads and decodes YAML values from an input stream.
|
// A Decoder reads and decodes YAML values from an input stream.
|
||||||
type Decoder struct {
|
type Decoder struct {
|
||||||
strict bool
|
strict bool
|
||||||
parser *parser
|
parser *parser
|
||||||
|
1
vendor/gopkg.in/yaml.v2/yamlh.go
generated
vendored
1
vendor/gopkg.in/yaml.v2/yamlh.go
generated
vendored
@ -579,6 +579,7 @@ type yaml_parser_t struct {
|
|||||||
|
|
||||||
simple_key_allowed bool // May a simple key occur at the current position?
|
simple_key_allowed bool // May a simple key occur at the current position?
|
||||||
simple_keys []yaml_simple_key_t // The stack of simple keys.
|
simple_keys []yaml_simple_key_t // The stack of simple keys.
|
||||||
|
simple_keys_by_tok map[int]int // possible simple_key indexes indexed by token_number
|
||||||
|
|
||||||
// Parser stuff
|
// Parser stuff
|
||||||
|
|
||||||
|
8
vendor/modules.txt
vendored
8
vendor/modules.txt
vendored
@ -1,4 +1,4 @@
|
|||||||
# code.cloudfoundry.org/bytefmt v0.0.0-20190819182555-854d396b647c
|
# code.cloudfoundry.org/bytefmt v0.0.0-20200131002437-cf55d5288a48
|
||||||
## explicit
|
## explicit
|
||||||
code.cloudfoundry.org/bytefmt
|
code.cloudfoundry.org/bytefmt
|
||||||
# github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815
|
# github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815
|
||||||
@ -6,7 +6,7 @@ code.cloudfoundry.org/bytefmt
|
|||||||
github.com/docopt/docopt-go
|
github.com/docopt/docopt-go
|
||||||
# github.com/go-asn1-ber/asn1-ber v1.3.1
|
# github.com/go-asn1-ber/asn1-ber v1.3.1
|
||||||
github.com/go-asn1-ber/asn1-ber
|
github.com/go-asn1-ber/asn1-ber
|
||||||
# github.com/go-ldap/ldap/v3 v3.1.6
|
# github.com/go-ldap/ldap/v3 v3.1.7
|
||||||
## explicit
|
## explicit
|
||||||
github.com/go-ldap/ldap/v3
|
github.com/go-ldap/ldap/v3
|
||||||
# github.com/go-sql-driver/mysql v1.5.0
|
# github.com/go-sql-driver/mysql v1.5.0
|
||||||
@ -59,7 +59,7 @@ github.com/tidwall/rtree
|
|||||||
github.com/tidwall/rtree/base
|
github.com/tidwall/rtree/base
|
||||||
# github.com/tidwall/tinyqueue v0.0.0-20180302190814-1e39f5511563
|
# github.com/tidwall/tinyqueue v0.0.0-20180302190814-1e39f5511563
|
||||||
github.com/tidwall/tinyqueue
|
github.com/tidwall/tinyqueue
|
||||||
# golang.org/x/crypto v0.0.0-20191112222119-e1110fd1c708
|
# golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073
|
||||||
## explicit
|
## explicit
|
||||||
golang.org/x/crypto/bcrypt
|
golang.org/x/crypto/bcrypt
|
||||||
golang.org/x/crypto/blowfish
|
golang.org/x/crypto/blowfish
|
||||||
@ -84,6 +84,6 @@ golang.org/x/text/transform
|
|||||||
golang.org/x/text/unicode/bidi
|
golang.org/x/text/unicode/bidi
|
||||||
golang.org/x/text/unicode/norm
|
golang.org/x/text/unicode/norm
|
||||||
golang.org/x/text/width
|
golang.org/x/text/width
|
||||||
# gopkg.in/yaml.v2 v2.2.5
|
# gopkg.in/yaml.v2 v2.2.8
|
||||||
## explicit
|
## explicit
|
||||||
gopkg.in/yaml.v2
|
gopkg.in/yaml.v2
|
||||||
|
Loading…
Reference in New Issue
Block a user