Skip to content

Commit

Permalink
rename refs to aaafs to go-authcrunch
Browse files Browse the repository at this point in the history
  • Loading branch information
greenpau committed Jan 22, 2022
1 parent c084759 commit d98f1be
Show file tree
Hide file tree
Showing 32 changed files with 81 additions and 81 deletions.
10 changes: 5 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ 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`
* `https://github.com/greenpau/aaasf` => `https://github.com/anonymous/aaasf`
* `https://github.com/greenpau/go-authcrunch` => `https://github.com/anonymous/go-authcrunch`

Provided you are in `tmpdev` directory, clone the forked repositories:

```bash
git clone [email protected]:anonymous/caddy-security.git
git clone [email protected]:anonymous/aaasf.git
git clone [email protected]:anonymous/go-authcrunch.git
```

Next, browse to `caddy-security` and run the following `make` command to install
Expand All @@ -81,10 +81,10 @@ module github.com/greenpau/caddy-security
go 1.16
require (
github.com/greenpau/aaasf v1.0.4
github.com/greenpau/go-authcrunch v1.0.5
)
replace github.com/greenpau/aaasf v1.0.4 => /home/greenpau/dev/go/src/github.com/greenpau/aaasf
replace github.com/greenpau/go-authcrunch v1.0.5 => /home/greenpau/dev/go/src/github.com/greenpau/go-authcrunch
```

Then, modify `Makefile` such that that replacement passes to `xcaddy` builder:
Expand All @@ -93,7 +93,7 @@ Then, modify `Makefile` such that that replacement passes to `xcaddy` builder:
@mkdir -p ../xcaddy-$(PLUGIN_NAME) && cd ../xcaddy-$(PLUGIN_NAME) && \
xcaddy build $(CADDY_VERSION) --output ../$(PLUGIN_NAME)/bin/caddy \
--with github.com/greenpau/caddy-security@$(LATEST_GIT_COMMIT)=$(BUILD_DIR) \
--with github.com/greenpau/aaasf@v1.0.4=/home/greenpau/dev/go/src/github.com/greenpau/aaasf
--with github.com/greenpau/go-authcrunch@v1.0.5=/home/greenpau/dev/go/src/github.com/greenpau/go-authcrunch
```

Once all the necessary packages are installed, you should be ready to compile
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ all: info
@mkdir -p ../xcaddy-$(PLUGIN_NAME) && cd ../xcaddy-$(PLUGIN_NAME) && \
xcaddy build $(CADDY_VERSION) --output ../$(PLUGIN_NAME)/bin/caddy \
--with github.com/greenpau/caddy-security@$(LATEST_GIT_COMMIT)=$(BUILD_DIR)
@#--with github.com/greenpau/aaasf@v1.0.4=/home/greenpau/dev/go/src/github.com/greenpau/aaasf
@#--with github.com/greenpau/go-authcrunch@v1.0.5=/home/greenpau/dev/go/src/github.com/greenpau/go-authcrunch
@#bin/caddy run -config assets/config/Caddyfile
@for f in `find ./assets -type f -name 'Caddyfile'`; do bin/caddy fmt -overwrite $$f; done

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ and serves authentication portal with `authenticate` keyword.

The app and plugin use Authentication, Authorization, and
Accounting (AAA) Security Functions (SF) from
[github.com/greenpau/aaasf](https://github.com/greenpau/aaasf).
[github.com/greenpau/authcrunch](https://github.com/greenpau/go-authcrunch).

## Getting Started

Expand Down
11 changes: 5 additions & 6 deletions app.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ package security

import (
"github.com/caddyserver/caddy/v2"
"github.com/greenpau/aaasf"
"github.com/greenpau/aaasf/pkg/authn"
"github.com/greenpau/aaasf/pkg/authz"
"github.com/greenpau/go-authcrunch"
"github.com/greenpau/go-authcrunch/pkg/authn"
"github.com/greenpau/go-authcrunch/pkg/authz"
"go.uber.org/zap"
)

Expand All @@ -37,9 +37,8 @@ func init() {

// App implements security manager.
type App struct {
Name string `json:"-"`
Config *aaasf.Config `json:"config,omitempty"`
// server *aaasf.Server
Name string `json:"-"`
Config *authcrunch.Config `json:"config,omitempty"`
logger *zap.Logger
portals []*authn.Portal
gatekeepers []*authz.Gatekeeper
Expand Down
4 changes: 2 additions & 2 deletions caddyfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"github.com/caddyserver/caddy/v2/caddyconfig/caddyfile"
"github.com/caddyserver/caddy/v2/caddyconfig/httpcaddyfile"
// "github.com/caddyserver/caddy/v2/modules/caddyhttp"
"github.com/greenpau/aaasf"
"github.com/greenpau/go-authcrunch"
// "strconv"
// "strings"
)
Expand All @@ -43,7 +43,7 @@ func init() {
func parseCaddyfile(d *caddyfile.Dispenser, _ interface{}) (interface{}, error) {
repl := caddy.NewReplacer()
app := new(App)
app.Config = aaasf.NewConfig()
app.Config = authcrunch.NewConfig()

if !d.Next() {
return nil, d.ArgErr()
Expand Down
16 changes: 8 additions & 8 deletions caddyfile_authn.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ package security
import (
"github.com/caddyserver/caddy/v2"
"github.com/caddyserver/caddy/v2/caddyconfig/caddyfile"
"github.com/greenpau/aaasf"
"github.com/greenpau/aaasf/pkg/authn"
"github.com/greenpau/aaasf/pkg/authn/cookie"
"github.com/greenpau/aaasf/pkg/authn/registration"
"github.com/greenpau/aaasf/pkg/authn/ui"
"github.com/greenpau/aaasf/pkg/authz/options"
"github.com/greenpau/aaasf/pkg/errors"
"github.com/greenpau/caddy-security/pkg/util"
"github.com/greenpau/go-authcrunch"
"github.com/greenpau/go-authcrunch/pkg/authn"
"github.com/greenpau/go-authcrunch/pkg/authn/cookie"
"github.com/greenpau/go-authcrunch/pkg/authn/registration"
"github.com/greenpau/go-authcrunch/pkg/authn/ui"
"github.com/greenpau/go-authcrunch/pkg/authz/options"
"github.com/greenpau/go-authcrunch/pkg/errors"
"strings"
)

Expand Down Expand Up @@ -104,7 +104,7 @@ const (
// validate source address
// }
//
func parseCaddyfileAuthentication(d *caddyfile.Dispenser, repl *caddy.Replacer, cfg *aaasf.Config) error {
func parseCaddyfileAuthentication(d *caddyfile.Dispenser, repl *caddy.Replacer, cfg *authcrunch.Config) error {
// rootDirective is config key prefix.
var rootDirective string
args := util.FindReplaceAll(repl, d.RemainingArgs())
Expand Down
6 changes: 3 additions & 3 deletions caddyfile_authn_backend_shortcut.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ import (
"fmt"
"github.com/caddyserver/caddy/v2"
"github.com/caddyserver/caddy/v2/caddyconfig/caddyfile"
"github.com/greenpau/aaasf/pkg/authn"
"github.com/greenpau/aaasf/pkg/authn/backends"
"github.com/greenpau/aaasf/pkg/errors"
"github.com/greenpau/go-authcrunch/pkg/authn"
"github.com/greenpau/go-authcrunch/pkg/authn/backends"
"github.com/greenpau/go-authcrunch/pkg/errors"
)

func parseCaddyfileAuthPortalBackendShortcuts(h *caddyfile.Dispenser, repl *caddy.Replacer, portal *authn.PortalConfig, ckp string, v []string) error {
Expand Down
4 changes: 2 additions & 2 deletions caddyfile_authn_backends.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ package security
import (
"github.com/caddyserver/caddy/v2"
"github.com/caddyserver/caddy/v2/caddyconfig/caddyfile"
"github.com/greenpau/aaasf/pkg/authn"
"github.com/greenpau/aaasf/pkg/authn/backends"
"github.com/greenpau/go-authcrunch/pkg/authn"
"github.com/greenpau/go-authcrunch/pkg/authn/backends"
"github.com/greenpau/caddy-security/pkg/util"
"strconv"
"strings"
Expand Down
4 changes: 2 additions & 2 deletions caddyfile_authn_cookie.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ package security
import (
"github.com/caddyserver/caddy/v2"
"github.com/caddyserver/caddy/v2/caddyconfig/caddyfile"
"github.com/greenpau/aaasf/pkg/authn"
cfgutil "github.com/greenpau/aaasf/pkg/util/cfg"
"github.com/greenpau/go-authcrunch/pkg/authn"
cfgutil "github.com/greenpau/go-authcrunch/pkg/util/cfg"
"strconv"
"strings"
)
Expand Down
6 changes: 3 additions & 3 deletions caddyfile_authn_crypto.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ package security
import (
"github.com/caddyserver/caddy/v2"
"github.com/caddyserver/caddy/v2/caddyconfig/caddyfile"
"github.com/greenpau/aaasf/pkg/authn"
"github.com/greenpau/aaasf/pkg/errors"
cfgutil "github.com/greenpau/aaasf/pkg/util/cfg"
"github.com/greenpau/go-authcrunch/pkg/authn"
"github.com/greenpau/go-authcrunch/pkg/errors"
cfgutil "github.com/greenpau/go-authcrunch/pkg/util/cfg"
)

func parseCaddyfileAuthPortalCrypto(h *caddyfile.Dispenser, repl *caddy.Replacer, portal *authn.PortalConfig, rootDirective string, args []string) error {
Expand Down
2 changes: 1 addition & 1 deletion caddyfile_authn_misc.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ package security
import (
"github.com/caddyserver/caddy/v2"
"github.com/caddyserver/caddy/v2/caddyconfig/caddyfile"
"github.com/greenpau/aaasf/pkg/authn"
"github.com/greenpau/go-authcrunch/pkg/authn"
"strings"
)

Expand Down
2 changes: 1 addition & 1 deletion caddyfile_authn_registration.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ package security
import (
"github.com/caddyserver/caddy/v2"
"github.com/caddyserver/caddy/v2/caddyconfig/caddyfile"
"github.com/greenpau/aaasf/pkg/authn"
"github.com/greenpau/go-authcrunch/pkg/authn"
"strings"
)

Expand Down
2 changes: 1 addition & 1 deletion caddyfile_authn_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"github.com/caddyserver/caddy/v2/caddyconfig/caddyfile"
"github.com/caddyserver/caddy/v2/caddyconfig/httpcaddyfile"
"github.com/google/go-cmp/cmp"
"github.com/greenpau/aaasf/pkg/errors"
"github.com/greenpau/go-authcrunch/pkg/errors"
)

func TestParseCaddyfileAuthentication(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions caddyfile_authn_transform.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ package security
import (
"github.com/caddyserver/caddy/v2"
"github.com/caddyserver/caddy/v2/caddyconfig/caddyfile"
"github.com/greenpau/aaasf/pkg/authn"
"github.com/greenpau/aaasf/pkg/authn/transformer"
cfgutil "github.com/greenpau/aaasf/pkg/util/cfg"
"github.com/greenpau/go-authcrunch/pkg/authn"
"github.com/greenpau/go-authcrunch/pkg/authn/transformer"
cfgutil "github.com/greenpau/go-authcrunch/pkg/util/cfg"
"strings"
)

Expand Down
4 changes: 2 additions & 2 deletions caddyfile_authn_ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ package security
import (
"github.com/caddyserver/caddy/v2"
"github.com/caddyserver/caddy/v2/caddyconfig/caddyfile"
"github.com/greenpau/aaasf/pkg/authn"
"github.com/greenpau/aaasf/pkg/authn/ui"
"github.com/greenpau/go-authcrunch/pkg/authn"
"github.com/greenpau/go-authcrunch/pkg/authn/ui"
"io/ioutil"
"strings"
)
Expand Down
8 changes: 4 additions & 4 deletions caddyfile_authz.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ package security
import (
"github.com/caddyserver/caddy/v2"
"github.com/caddyserver/caddy/v2/caddyconfig/caddyfile"
"github.com/greenpau/aaasf"
"github.com/greenpau/aaasf/pkg/authz"
"github.com/greenpau/aaasf/pkg/errors"
"github.com/greenpau/caddy-security/pkg/util"
"github.com/greenpau/go-authcrunch"
"github.com/greenpau/go-authcrunch/pkg/authz"
"github.com/greenpau/go-authcrunch/pkg/errors"
)

const (
Expand All @@ -34,7 +34,7 @@ const (
// authorization portal <name> {
// }
//
func parseCaddyfileAuthorization(d *caddyfile.Dispenser, repl *caddy.Replacer, cfg *aaasf.Config) error {
func parseCaddyfileAuthorization(d *caddyfile.Dispenser, repl *caddy.Replacer, cfg *authcrunch.Config) error {
var rootDirective string
args := util.FindReplaceAll(repl, d.RemainingArgs())
if len(args) != 2 {
Expand Down
6 changes: 3 additions & 3 deletions caddyfile_authz_acl.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ package security
import (
"github.com/caddyserver/caddy/v2"
"github.com/caddyserver/caddy/v2/caddyconfig/caddyfile"
"github.com/greenpau/aaasf/pkg/acl"
"github.com/greenpau/aaasf/pkg/authz"
cfgutil "github.com/greenpau/aaasf/pkg/util/cfg"
"github.com/greenpau/go-authcrunch/pkg/acl"
"github.com/greenpau/go-authcrunch/pkg/authz"
cfgutil "github.com/greenpau/go-authcrunch/pkg/util/cfg"
"strings"
)

Expand Down
6 changes: 3 additions & 3 deletions caddyfile_authz_acl_shortcuts.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ package security
import (
"github.com/caddyserver/caddy/v2"
"github.com/caddyserver/caddy/v2/caddyconfig/caddyfile"
"github.com/greenpau/aaasf/pkg/acl"
"github.com/greenpau/aaasf/pkg/authz"
cfgutil "github.com/greenpau/aaasf/pkg/util/cfg"
"github.com/greenpau/go-authcrunch/pkg/acl"
"github.com/greenpau/go-authcrunch/pkg/authz"
cfgutil "github.com/greenpau/go-authcrunch/pkg/util/cfg"
"strings"
)

Expand Down
6 changes: 3 additions & 3 deletions caddyfile_authz_bypass.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ package security
import (
"github.com/caddyserver/caddy/v2"
"github.com/caddyserver/caddy/v2/caddyconfig/caddyfile"
"github.com/greenpau/aaasf/pkg/authz"
"github.com/greenpau/aaasf/pkg/authz/bypass"
cfgutil "github.com/greenpau/aaasf/pkg/util/cfg"
"github.com/greenpau/go-authcrunch/pkg/authz"
"github.com/greenpau/go-authcrunch/pkg/authz/bypass"
cfgutil "github.com/greenpau/go-authcrunch/pkg/util/cfg"
)

func parseCaddyfileAuthorizationBypass(h *caddyfile.Dispenser, repl *caddy.Replacer, p *authz.PolicyConfig, rootDirective string, args []string) error {
Expand Down
6 changes: 3 additions & 3 deletions caddyfile_authz_crypto.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ package security
import (
"github.com/caddyserver/caddy/v2"
"github.com/caddyserver/caddy/v2/caddyconfig/caddyfile"
"github.com/greenpau/aaasf/pkg/authz"
"github.com/greenpau/aaasf/pkg/errors"
cfgutil "github.com/greenpau/aaasf/pkg/util/cfg"
"github.com/greenpau/go-authcrunch/pkg/authz"
"github.com/greenpau/go-authcrunch/pkg/errors"
cfgutil "github.com/greenpau/go-authcrunch/pkg/util/cfg"
)

func parseCaddyfileAuthorizationCrypto(h *caddyfile.Dispenser, repl *caddy.Replacer, policy *authz.PolicyConfig, rootDirective string, args []string) error {
Expand Down
6 changes: 3 additions & 3 deletions caddyfile_authz_inject.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ package security
import (
"github.com/caddyserver/caddy/v2"
"github.com/caddyserver/caddy/v2/caddyconfig/caddyfile"
"github.com/greenpau/aaasf/pkg/authz"
"github.com/greenpau/aaasf/pkg/authz/injector"
cfgutil "github.com/greenpau/aaasf/pkg/util/cfg"
"github.com/greenpau/go-authcrunch/pkg/authz"
"github.com/greenpau/go-authcrunch/pkg/authz/injector"
cfgutil "github.com/greenpau/go-authcrunch/pkg/util/cfg"
)

func parseCaddyfileAuthorizationHeaderInjection(h *caddyfile.Dispenser, repl *caddy.Replacer, p *authz.PolicyConfig, rootDirective string, args []string) error {
Expand Down
4 changes: 2 additions & 2 deletions caddyfile_authz_misc.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ package security
import (
"github.com/caddyserver/caddy/v2"
"github.com/caddyserver/caddy/v2/caddyconfig/caddyfile"
"github.com/greenpau/aaasf/pkg/authz"
cfgutil "github.com/greenpau/aaasf/pkg/util/cfg"
"github.com/greenpau/go-authcrunch/pkg/authz"
cfgutil "github.com/greenpau/go-authcrunch/pkg/util/cfg"
"strconv"
"strings"
)
Expand Down
2 changes: 1 addition & 1 deletion caddyfile_authz_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"github.com/caddyserver/caddy/v2/caddyconfig/caddyfile"
"github.com/caddyserver/caddy/v2/caddyconfig/httpcaddyfile"
"github.com/google/go-cmp/cmp"
"github.com/greenpau/aaasf/pkg/errors"
"github.com/greenpau/go-authcrunch/pkg/errors"
)

func TestParseCaddyfileAuthorization(t *testing.T) {
Expand Down
8 changes: 4 additions & 4 deletions caddyfile_credentials.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ package security
import (
"github.com/caddyserver/caddy/v2"
"github.com/caddyserver/caddy/v2/caddyconfig/caddyfile"
"github.com/greenpau/aaasf"
"github.com/greenpau/aaasf/pkg/credentials"
"github.com/greenpau/aaasf/pkg/errors"
"github.com/greenpau/caddy-security/pkg/util"
"github.com/greenpau/go-authcrunch"
"github.com/greenpau/go-authcrunch/pkg/credentials"
"github.com/greenpau/go-authcrunch/pkg/errors"
)

const (
Expand All @@ -38,7 +38,7 @@ const (
// password <password>
// }
//
func parseCaddyfileCredentials(d *caddyfile.Dispenser, repl *caddy.Replacer, cfg *aaasf.Config) error {
func parseCaddyfileCredentials(d *caddyfile.Dispenser, repl *caddy.Replacer, cfg *authcrunch.Config) error {
args := util.FindReplaceAll(repl, d.RemainingArgs())
if len(args) != 2 {
return d.ArgErr()
Expand Down
2 changes: 1 addition & 1 deletion caddyfile_credentials_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"github.com/caddyserver/caddy/v2/caddyconfig/caddyfile"
"github.com/caddyserver/caddy/v2/caddyconfig/httpcaddyfile"
"github.com/google/go-cmp/cmp"
"github.com/greenpau/aaasf/pkg/errors"
"github.com/greenpau/go-authcrunch/pkg/errors"
)

func TestParseCaddyfileCredentials(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion caddyfile_plugin_authn.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"github.com/caddyserver/caddy/v2/caddyconfig"
"github.com/caddyserver/caddy/v2/caddyconfig/httpcaddyfile"
"github.com/caddyserver/caddy/v2/modules/caddyhttp"
"github.com/greenpau/aaasf/pkg/authn"
"github.com/greenpau/go-authcrunch/pkg/authn"
"github.com/greenpau/caddy-security/pkg/util"
)

Expand Down
2 changes: 1 addition & 1 deletion caddyfile_plugin_authz.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"github.com/caddyserver/caddy/v2/caddyconfig/httpcaddyfile"
"github.com/caddyserver/caddy/v2/modules/caddyhttp"
"github.com/caddyserver/caddy/v2/modules/caddyhttp/caddyauth"
"github.com/greenpau/aaasf/pkg/authz"
"github.com/greenpau/go-authcrunch/pkg/authz"
"github.com/greenpau/caddy-security/pkg/util"
)

Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ go 1.16

require (
github.com/caddyserver/caddy/v2 v2.4.6
github.com/google/go-cmp v0.5.6
github.com/greenpau/aaasf v1.0.4
github.com/google/go-cmp v0.5.7
github.com/greenpau/go-authcrunch v1.0.5
github.com/satori/go.uuid v1.2.0
go.uber.org/zap v1.20.0
)
Loading

0 comments on commit d98f1be

Please sign in to comment.