diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 1c7808e..83d7ff6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -23,7 +23,7 @@ Before sending your pull requests, make sure you followed this list. ## Development Environment -The contribution to this project requires setting up a development +Contribution to this project requires setting up a development environment. The following steps allow developers to test their setup using local source code. @@ -34,7 +34,7 @@ mkdir -p ~/tmpdev cd ~/tmpdev ``` -Second, fork the following repositories in Github into to your own Github +Second, fork the following repositories in GitHub into to your own GitHub handle, e.g. `anonymous`: * `https://github.com/greenpau/caddy-security` => `https://github.com/anonymous/caddy-security` @@ -57,7 +57,7 @@ make dep Next, modify `go.mod` in `github.com/greenpau/caddy-security`. Include `replace` directives to instruct `go` using local directories, as opposed -to follow Github versions. +to follow GitHub versions. Note: the referenced versions must match. diff --git a/Makefile b/Makefile index 6db8eb2..5bedcce 100644 --- a/Makefile +++ b/Makefile @@ -82,7 +82,6 @@ qtest: covdir @time richgo test -v -coverprofile=.coverage/coverage.out -run TestParseCaddyfileSingleSignOnProvider ./*.go @#time richgo test -v -coverprofile=.coverage/coverage.out -run TestParseCaddyfileCredentials ./*.go @#time richgo test -v -coverprofile=.coverage/coverage.out -run TestParseCaddyfileMessaging ./*.go - @#time richgo test -v -coverprofile=.coverage/coverage.out -run TestParseCaddyfileIdentit* ./*.go @#time richgo test -v -coverprofile=.coverage/coverage.out -run TestParseCaddyfileAuthentication ./*.go @#time richgo test -v -coverprofile=.coverage/coverage.out -run TestParseCaddyfileAuthorization ./*.go @#go test -v -coverprofile=.coverage/coverage.out -run TestParseCaddyfile ./*.go diff --git a/README.md b/README.md index e05770a..e8770af 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ Security App and Plugin for [Caddy v2](https://github.com/caddyserver/caddy). It Please show your **appreciation for this work** and :star: :star: :star: -Please consider **sponsoring this project** via Github Sponsors! +Please consider **sponsoring this project** via GitHub Sponsors! Please ask questions either here or via LinkedIn. I am happy to help you! @greenpau diff --git a/caddyfile_authn_ui.go b/caddyfile_authn_ui.go index 41f999a..d8e478e 100644 --- a/caddyfile_authn_ui.go +++ b/caddyfile_authn_ui.go @@ -15,13 +15,14 @@ package security import ( + "os" + "strings" + "github.com/caddyserver/caddy/v2" "github.com/caddyserver/caddy/v2/caddyconfig/caddyfile" "github.com/greenpau/caddy-security/pkg/util" "github.com/greenpau/go-authcrunch/pkg/authn" "github.com/greenpau/go-authcrunch/pkg/authn/ui" - "io/ioutil" - "strings" ) func parseCaddyfileAuthPortalUI(h *caddyfile.Dispenser, repl *caddy.Replacer, portal *authn.PortalConfig, rootDirective string) error { @@ -131,7 +132,7 @@ func parseCaddyfileAuthPortalUI(h *caddyfile.Dispenser, repl *caddy.Replacer, po portal.UI.CustomJsPath = strings.ReplaceAll(args, "js ", "") case strings.HasPrefix(args, "html header path"): args = strings.ReplaceAll(args, "html header path ", "") - b, err := ioutil.ReadFile(args) + b, err := os.ReadFile(args) if err != nil { return h.Errf("%s %s subdirective: %s %v", rootDirective, subDirective, args, err) } diff --git a/caddyfile_authz_test.go b/caddyfile_authz_test.go index a9b7de2..22c6d54 100644 --- a/caddyfile_authz_test.go +++ b/caddyfile_authz_test.go @@ -591,7 +591,7 @@ func TestParseCaddyfileAuthorization(t *testing.T) { err: fmt.Errorf("security.authorization.policy.with directive has no value, at %s:%d", tf, 4), }, { - name: "test authorization policy with with unsupported directive", + name: "test authorization policy with unsupported directive", d: caddyfile.NewTestDispenser(` security { authorization policy mypolicy { diff --git a/plugin_authz.go b/plugin_authz.go index 2a78742..bab1022 100644 --- a/plugin_authz.go +++ b/plugin_authz.go @@ -39,7 +39,7 @@ func init() { } // AuthzMiddleware authorizes access to endpoints based on -// the presense and content of JWT token. +// the presence and content of JWT token. type AuthzMiddleware struct { RouteMatcher string `json:"route_matcher,omitempty" xml:"route_matcher,omitempty" yaml:"route_matcher,omitempty"` GatekeeperName string `json:"gatekeeper_name,omitempty" xml:"gatekeeper_name,omitempty" yaml:"gatekeeper_name,omitempty"` @@ -103,7 +103,7 @@ func (m *AuthzMiddleware) Validate() error { return nil } -// Authenticate authorizes access based on the presense and content of +// Authenticate authorizes access based on the presence and content of // authorization token. func (m AuthzMiddleware) Authenticate(w http.ResponseWriter, r *http.Request) (caddyauth.User, bool, error) { ar := requests.NewAuthorizationRequest()