summaryrefslogtreecommitdiffstats
path: root/vendor/go.jolheiser.com
diff options
context:
space:
mode:
authortechknowlogick <techknowlogick@gitea.io>2022-01-14 18:16:05 -0500
committerGitHub <noreply@github.com>2022-01-14 18:16:05 -0500
commit84145e45c50130922fae9055535ab5ea0378e1d4 (patch)
treefce077a5ae462840bb876ace79aca42abab29ed7 /vendor/go.jolheiser.com
parent2b16ca7c773de278ba01f122dc6f9f43d7534c52 (diff)
downloadgitea-84145e45c50130922fae9055535ab5ea0378e1d4.tar.gz
gitea-84145e45c50130922fae9055535ab5ea0378e1d4.zip
Remove golang vendored directory (#18277)
* rm go vendor * fix drone yaml * add to gitignore
Diffstat (limited to 'vendor/go.jolheiser.com')
-rw-r--r--vendor/go.jolheiser.com/hcaptcha/.gitignore2
-rw-r--r--vendor/go.jolheiser.com/hcaptcha/LICENSE7
-rw-r--r--vendor/go.jolheiser.com/hcaptcha/Makefile13
-rw-r--r--vendor/go.jolheiser.com/hcaptcha/README.md9
-rw-r--r--vendor/go.jolheiser.com/hcaptcha/error.go41
-rw-r--r--vendor/go.jolheiser.com/hcaptcha/go.mod3
-rw-r--r--vendor/go.jolheiser.com/hcaptcha/hcaptcha.go105
-rw-r--r--vendor/go.jolheiser.com/hcaptcha/response.go10
-rw-r--r--vendor/go.jolheiser.com/pwn/.gitignore6
-rw-r--r--vendor/go.jolheiser.com/pwn/LICENSE7
-rw-r--r--vendor/go.jolheiser.com/pwn/Makefile18
-rw-r--r--vendor/go.jolheiser.com/pwn/README.md13
-rw-r--r--vendor/go.jolheiser.com/pwn/error.go15
-rw-r--r--vendor/go.jolheiser.com/pwn/go.mod3
-rw-r--r--vendor/go.jolheiser.com/pwn/password.go62
-rw-r--r--vendor/go.jolheiser.com/pwn/pwn.go58
16 files changed, 0 insertions, 372 deletions
diff --git a/vendor/go.jolheiser.com/hcaptcha/.gitignore b/vendor/go.jolheiser.com/hcaptcha/.gitignore
deleted file mode 100644
index a4539540fa..0000000000
--- a/vendor/go.jolheiser.com/hcaptcha/.gitignore
+++ /dev/null
@@ -1,2 +0,0 @@
-# GoLand
-.idea/ \ No newline at end of file
diff --git a/vendor/go.jolheiser.com/hcaptcha/LICENSE b/vendor/go.jolheiser.com/hcaptcha/LICENSE
deleted file mode 100644
index 0f02641b29..0000000000
--- a/vendor/go.jolheiser.com/hcaptcha/LICENSE
+++ /dev/null
@@ -1,7 +0,0 @@
-Copyright 2020 John Olheiser
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file
diff --git a/vendor/go.jolheiser.com/hcaptcha/Makefile b/vendor/go.jolheiser.com/hcaptcha/Makefile
deleted file mode 100644
index 5b4272f3ae..0000000000
--- a/vendor/go.jolheiser.com/hcaptcha/Makefile
+++ /dev/null
@@ -1,13 +0,0 @@
-GO ?= go
-
-.PHONY: fmt
-fmt:
- $(GO) fmt ./...
-
-.PHONY: test
-test:
- $(GO) test -race ./...
-
-.PHONY: vet
-vet:
- $(GO) vet ./... \ No newline at end of file
diff --git a/vendor/go.jolheiser.com/hcaptcha/README.md b/vendor/go.jolheiser.com/hcaptcha/README.md
deleted file mode 100644
index b13dc2d467..0000000000
--- a/vendor/go.jolheiser.com/hcaptcha/README.md
+++ /dev/null
@@ -1,9 +0,0 @@
-# hCaptcha
-
-This library was based on the hCaptcha server-side verification [docs](https://docs.hcaptcha.com/#server).
-
-[Example](example_test.go)
-
-## License
-
-[MIT](LICENSE) \ No newline at end of file
diff --git a/vendor/go.jolheiser.com/hcaptcha/error.go b/vendor/go.jolheiser.com/hcaptcha/error.go
deleted file mode 100644
index 6e4d165523..0000000000
--- a/vendor/go.jolheiser.com/hcaptcha/error.go
+++ /dev/null
@@ -1,41 +0,0 @@
-package hcaptcha
-
-const (
- ErrMissingInputSecret ErrorCode = "missing-input-secret"
- ErrInvalidInputSecret ErrorCode = "invalid-input-secret"
- ErrMissingInputResponse ErrorCode = "missing-input-response"
- ErrInvalidInputResponse ErrorCode = "invalid-input-response"
- ErrBadRequest ErrorCode = "bad-request"
- ErrInvalidOrAlreadySeenResponse ErrorCode = "invalid-or-already-seen-response"
- ErrSitekeySecretMismatch ErrorCode = "sitekey-secret-mismatch"
-)
-
-// ErrorCode is any possible error from hCaptcha
-type ErrorCode string
-
-// String fulfills the Stringer interface
-func (err ErrorCode) String() string {
- switch err {
- case ErrMissingInputSecret:
- return "Your secret key is missing."
- case ErrInvalidInputSecret:
- return "Your secret key is invalid or malformed."
- case ErrMissingInputResponse:
- return "The response parameter (verification token) is missing."
- case ErrInvalidInputResponse:
- return "The response parameter (verification token) is invalid or malformed."
- case ErrBadRequest:
- return "The request is invalid or malformed."
- case ErrInvalidOrAlreadySeenResponse:
- return "The response parameter has already been checked, or has another issue."
- case ErrSitekeySecretMismatch:
- return "The sitekey is not registered with the provided secret."
- default:
- return ""
- }
-}
-
-// Error fulfills the error interface
-func (err ErrorCode) Error() string {
- return err.String()
-}
diff --git a/vendor/go.jolheiser.com/hcaptcha/go.mod b/vendor/go.jolheiser.com/hcaptcha/go.mod
deleted file mode 100644
index 7306dc347d..0000000000
--- a/vendor/go.jolheiser.com/hcaptcha/go.mod
+++ /dev/null
@@ -1,3 +0,0 @@
-module go.jolheiser.com/hcaptcha
-
-go 1.15
diff --git a/vendor/go.jolheiser.com/hcaptcha/hcaptcha.go b/vendor/go.jolheiser.com/hcaptcha/hcaptcha.go
deleted file mode 100644
index 1f21f84008..0000000000
--- a/vendor/go.jolheiser.com/hcaptcha/hcaptcha.go
+++ /dev/null
@@ -1,105 +0,0 @@
-package hcaptcha
-
-import (
- "context"
- "encoding/json"
- "io/ioutil"
- "net/http"
- "net/url"
- "strings"
-)
-
-const verifyURL = "https://hcaptcha.com/siteverify"
-
-// Client is an hCaptcha client
-type Client struct {
- ctx context.Context
- http *http.Client
-
- secret string
-}
-
-// PostOptions are optional post form values
-type PostOptions struct {
- RemoteIP string
- Sitekey string
-}
-
-// ClientOption is a func to modify a new Client
-type ClientOption func(*Client)
-
-// WithHTTP sets the http.Client of a Client
-func WithHTTP(httpClient *http.Client) func(*Client) {
- return func(hClient *Client) {
- hClient.http = httpClient
- }
-}
-
-// WithContext sets the context.Context of a Client
-func WithContext(ctx context.Context) func(*Client) {
- return func(hClient *Client) {
- hClient.ctx = ctx
- }
-}
-
-// New returns a new hCaptcha Client
-func New(secret string, options ...ClientOption) (*Client, error) {
- if strings.TrimSpace(secret) == "" {
- return nil, ErrMissingInputSecret
- }
-
- client := &Client{
- ctx: context.Background(),
- http: http.DefaultClient,
- secret: secret,
- }
-
- for _, opt := range options {
- opt(client)
- }
-
- return client, nil
-}
-
-// Verify checks the response against the hCaptcha API
-func (c *Client) Verify(token string, opts PostOptions) (*Response, error) {
- if strings.TrimSpace(token) == "" {
- return nil, ErrMissingInputResponse
- }
-
- post := url.Values{
- "secret": []string{c.secret},
- "response": []string{token},
- }
- if strings.TrimSpace(opts.RemoteIP) != "" {
- post.Add("remoteip", opts.RemoteIP)
- }
- if strings.TrimSpace(opts.Sitekey) != "" {
- post.Add("sitekey", opts.Sitekey)
- }
-
- // Basically a copy of http.PostForm, but with a context
- req, err := http.NewRequestWithContext(c.ctx, http.MethodPost, verifyURL, strings.NewReader(post.Encode()))
- if err != nil {
- return nil, err
- }
- req.Header.Set("Content-Type", "application/x-www-form-urlencoded")
-
- resp, err := c.http.Do(req)
- if err != nil {
- return nil, err
- }
-
- body, err := ioutil.ReadAll(resp.Body)
- if err != nil {
- return nil, err
- }
- defer resp.Body.Close()
-
- var response *Response
- if err := json.Unmarshal(body, &response); err != nil {
- return nil, err
- }
-
- return response, nil
-}
diff --git a/vendor/go.jolheiser.com/hcaptcha/response.go b/vendor/go.jolheiser.com/hcaptcha/response.go
deleted file mode 100644
index 007276e6c1..0000000000
--- a/vendor/go.jolheiser.com/hcaptcha/response.go
+++ /dev/null
@@ -1,10 +0,0 @@
-package hcaptcha
-
-// Response is an hCaptcha response
-type Response struct {
- Success bool `json:"success"`
- ChallengeTS string `json:"challenge_ts"`
- Hostname string `json:"hostname"`
- Credit bool `json:"credit,omitempty"`
- ErrorCodes []ErrorCode `json:"error-codes"`
-}
diff --git a/vendor/go.jolheiser.com/pwn/.gitignore b/vendor/go.jolheiser.com/pwn/.gitignore
deleted file mode 100644
index b73cf3849a..0000000000
--- a/vendor/go.jolheiser.com/pwn/.gitignore
+++ /dev/null
@@ -1,6 +0,0 @@
-# GoLand
-.idea/
-
-# Binaries
-/pwn
-/pwn.exe \ No newline at end of file
diff --git a/vendor/go.jolheiser.com/pwn/LICENSE b/vendor/go.jolheiser.com/pwn/LICENSE
deleted file mode 100644
index 0f02641b29..0000000000
--- a/vendor/go.jolheiser.com/pwn/LICENSE
+++ /dev/null
@@ -1,7 +0,0 @@
-Copyright 2020 John Olheiser
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file
diff --git a/vendor/go.jolheiser.com/pwn/Makefile b/vendor/go.jolheiser.com/pwn/Makefile
deleted file mode 100644
index 7f54744011..0000000000
--- a/vendor/go.jolheiser.com/pwn/Makefile
+++ /dev/null
@@ -1,18 +0,0 @@
-GO ?= go
-VERSION ?= $(shell git describe --tags --always | sed 's/-/+/' | sed 's/^v//')
-
-.PHONY: fmt
-fmt:
- $(GO) fmt ./...
-
-.PHONY: test
-test:
- $(GO) test -race ./...
-
-.PHONY: vet
-vet:
- $(GO) vet ./...
-
-.PHONY: build
-build:
- $(GO) build -ldflags '-s -w -X "main.Version=$(VERSION)"' go.jolheiser.com/pwn/cmd/pwn \ No newline at end of file
diff --git a/vendor/go.jolheiser.com/pwn/README.md b/vendor/go.jolheiser.com/pwn/README.md
deleted file mode 100644
index 9b3c37eb23..0000000000
--- a/vendor/go.jolheiser.com/pwn/README.md
+++ /dev/null
@@ -1,13 +0,0 @@
-# Have I Been Pwned
-
-Go library for interacting with [HaveIBeenPwned](https://haveibeenpwned.com/).
-
-Implemented:
-
-* [ ] Breaches
-* [ ] Pastes
-* [x] Passwords
-
-## License
-
-[MIT](LICENSE) \ No newline at end of file
diff --git a/vendor/go.jolheiser.com/pwn/error.go b/vendor/go.jolheiser.com/pwn/error.go
deleted file mode 100644
index 2c73ed5cee..0000000000
--- a/vendor/go.jolheiser.com/pwn/error.go
+++ /dev/null
@@ -1,15 +0,0 @@
-package pwn
-
-// ErrEmptyPassword is an empty password error
-type ErrEmptyPassword struct{}
-
-// Error fulfills the error interface
-func (e ErrEmptyPassword) Error() string {
- return "password cannot be empty"
-}
-
-// IsErrEmptyPassword checks if an error is ErrEmptyPassword
-func IsErrEmptyPassword(err error) bool {
- _, ok := err.(ErrEmptyPassword)
- return ok
-}
diff --git a/vendor/go.jolheiser.com/pwn/go.mod b/vendor/go.jolheiser.com/pwn/go.mod
deleted file mode 100644
index 46b73c8e5c..0000000000
--- a/vendor/go.jolheiser.com/pwn/go.mod
+++ /dev/null
@@ -1,3 +0,0 @@
-module go.jolheiser.com/pwn
-
-go 1.15
diff --git a/vendor/go.jolheiser.com/pwn/password.go b/vendor/go.jolheiser.com/pwn/password.go
deleted file mode 100644
index 848ac49188..0000000000
--- a/vendor/go.jolheiser.com/pwn/password.go
+++ /dev/null
@@ -1,62 +0,0 @@
-package pwn
-
-import (
- "crypto/sha1"
- "encoding/hex"
- "fmt"
- "io/ioutil"
- "net/http"
- "strconv"
- "strings"
-)
-
-const passwordURL = "https://api.pwnedpasswords.com/range/"
-
-// CheckPassword returns the number of times a password has been compromised
-// Adding padding will make requests more secure, however is also slower
-// because artificial responses will be added to the response
-// For more information, see https://www.troyhunt.com/enhancing-pwned-passwords-privacy-with-padding/
-func (c *Client) CheckPassword(pw string, padding bool) (int, error) {
- if strings.TrimSpace(pw) == "" {
- return -1, ErrEmptyPassword{}
- }
-
- sha := sha1.New()
- sha.Write([]byte(pw))
- enc := hex.EncodeToString(sha.Sum(nil))
- prefix, suffix := enc[:5], enc[5:]
-
- req, err := newRequest(c.ctx, http.MethodGet, fmt.Sprintf("%s%s", passwordURL, prefix), nil)
- if err != nil {
- return -1, nil
- }
- if padding {
- req.Header.Add("Add-Padding", "true")
- }
-
- resp, err := c.http.Do(req)
- if err != nil {
- return -1, err
- }
-
- body, err := ioutil.ReadAll(resp.Body)
- if err != nil {
- return -1, err
- }
- defer resp.Body.Close()
-
- for _, pair := range strings.Split(string(body), "\n") {
- parts := strings.Split(pair, ":")
- if len(parts) != 2 {
- continue
- }
- if strings.EqualFold(suffix, parts[0]) {
- count, err := strconv.ParseInt(strings.TrimSpace(parts[1]), 10, 64)
- if err != nil {
- return -1, err
- }
- return int(count), nil
- }
- }
- return 0, nil
-}
diff --git a/vendor/go.jolheiser.com/pwn/pwn.go b/vendor/go.jolheiser.com/pwn/pwn.go
deleted file mode 100644
index 399284b487..0000000000
--- a/vendor/go.jolheiser.com/pwn/pwn.go
+++ /dev/null
@@ -1,58 +0,0 @@
-package pwn
-
-import (
- "context"
- "io"
- "net/http"
-)
-
-const (
- libVersion = "0.0.3"
- userAgent = "go.jolheiser.com/pwn v" + libVersion
-)
-
-// Client is a HaveIBeenPwned client
-type Client struct {
- ctx context.Context
- http *http.Client
-}
-
-// New returns a new HaveIBeenPwned Client
-func New(options ...ClientOption) *Client {
- client := &Client{
- ctx: context.Background(),
- http: http.DefaultClient,
- }
-
- for _, opt := range options {
- opt(client)
- }
-
- return client
-}
-
-// ClientOption is a way to modify a new Client
-type ClientOption func(*Client)
-
-// WithHTTP will set the http.Client of a Client
-func WithHTTP(httpClient *http.Client) func(pwnClient *Client) {
- return func(pwnClient *Client) {
- pwnClient.http = httpClient
- }
-}
-
-// WithContext will set the context.Context of a Client
-func WithContext(ctx context.Context) func(pwnClient *Client) {
- return func(pwnClient *Client) {
- pwnClient.ctx = ctx
- }
-}
-
-func newRequest(ctx context.Context, method, url string, body io.ReadCloser) (*http.Request, error) {
- req, err := http.NewRequestWithContext(ctx, method, url, body)
- if err != nil {
- return nil, err
- }
- req.Header.Add("User-Agent", userAgent)
- return req, nil
-}