Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion plugins/azureadb2c/pkg/verify/verifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func (v *Verifier) Verify(ctx context.Context) error {
_, errReq := v.client.ListUsers(ctx, v.Groups, []string{"id"})

if errReq != nil {
return errors.Wrap(errReq, "failed to retrieve users from AzureAD")
return errors.Wrap(errReq, "failed to retrieve users from AzureAD (B2C)")
}

return nil
Expand Down
4 changes: 2 additions & 2 deletions plugins/fusionauth/pkg/app/exec.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package app

import (
"github.com/aserto-dev/ds-load/plugins/fusionauth/pkg/client"
"github.com/aserto-dev/ds-load/plugins/fusionauth/pkg/fetch"
"github.com/aserto-dev/ds-load/plugins/fusionauth/pkg/fusionauthclient"
"github.com/aserto-dev/ds-load/sdk/common/cc"
"github.com/aserto-dev/ds-load/sdk/exec"
"github.com/aserto-dev/ds-load/sdk/transform"
Expand All @@ -14,7 +14,7 @@ type ExecCmd struct {
}

func (cmd *ExecCmd) Run(ctx *cc.CommonCtx) error {
fusionauthClient, err := fusionauthclient.NewFusionAuthClient(cmd.HostURL, cmd.APIKey)
fusionauthClient, err := client.NewFusionAuthClient(cmd.HostURL, cmd.APIKey)
if err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions plugins/fusionauth/pkg/app/fetch.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package app
import (
"os"

"github.com/aserto-dev/ds-load/plugins/fusionauth/pkg/client"
"github.com/aserto-dev/ds-load/plugins/fusionauth/pkg/fetch"
"github.com/aserto-dev/ds-load/plugins/fusionauth/pkg/fusionauthclient"
"github.com/aserto-dev/ds-load/sdk/common"
"github.com/aserto-dev/ds-load/sdk/common/cc"
)
Expand All @@ -16,7 +16,7 @@ type FetchCmd struct {
}

func (cmd *FetchCmd) Run(ctx *cc.CommonCtx) error {
fusionauthClient, err := fusionauthclient.NewFusionAuthClient(cmd.HostURL, cmd.APIKey)
fusionauthClient, err := client.NewFusionAuthClient(cmd.HostURL, cmd.APIKey)
if err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions plugins/fusionauth/pkg/app/verify.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package app

import (
"github.com/aserto-dev/ds-load/plugins/fusionauth/pkg/fusionauthclient"
"github.com/aserto-dev/ds-load/plugins/fusionauth/pkg/client"
"github.com/aserto-dev/ds-load/plugins/fusionauth/pkg/verify"
"github.com/aserto-dev/ds-load/sdk/common/cc"
)
Expand All @@ -11,7 +11,7 @@ type VerifyCmd struct {
}

func (v *VerifyCmd) Run(ctx *cc.CommonCtx) error {
fusionauthClient, err := fusionauthclient.NewFusionAuthClient(v.HostURL, v.APIKey)
fusionauthClient, err := client.NewFusionAuthClient(v.HostURL, v.APIKey)
if err != nil {
return err
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package fusionauthclient
package client

import (
"context"
Expand Down
6 changes: 3 additions & 3 deletions plugins/fusionauth/pkg/fetch/fetch.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@ import (
"fmt"
"io"

"github.com/aserto-dev/ds-load/plugins/fusionauth/pkg/fusionauthclient"
"github.com/aserto-dev/ds-load/plugins/fusionauth/pkg/client"
"github.com/aserto-dev/ds-load/sdk/common"
"github.com/aserto-dev/ds-load/sdk/common/js"
)

type Fetcher struct {
fusionauthClient *fusionauthclient.FusionAuthClient
fusionauthClient *client.FusionAuthClient
groups bool
host string
}

func New(client *fusionauthclient.FusionAuthClient) (*Fetcher, error) {
func New(client *client.FusionAuthClient) (*Fetcher, error) {
return &Fetcher{
fusionauthClient: client,
}, nil
Expand Down
6 changes: 3 additions & 3 deletions plugins/fusionauth/pkg/verify/verifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ package verify
import (
"context"

"github.com/aserto-dev/ds-load/plugins/fusionauth/pkg/fusionauthclient"
"github.com/aserto-dev/ds-load/plugins/fusionauth/pkg/client"
"github.com/pkg/errors"
)

type Verifier struct {
client *fusionauthclient.FusionAuthClient
client *client.FusionAuthClient
}

func New(ctx context.Context, client *fusionauthclient.FusionAuthClient) (*Verifier, error) {
func New(ctx context.Context, client *client.FusionAuthClient) (*Verifier, error) {
return &Verifier{
client: client,
}, nil
Expand Down
1 change: 1 addition & 0 deletions plugins/jumpcloud/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ replace github.com/aserto-dev/ds-load/sdk => ../../sdk
require (
github.com/alecthomas/kong v1.10.0
github.com/aserto-dev/ds-load/sdk v0.0.0-20250408143332-e8965667fcc0
github.com/go-http-utils/headers v0.0.0-20181008091004-fed159eddc2a
github.com/pkg/errors v0.9.1
github.com/samber/lo v1.50.0
github.com/stretchr/testify v1.10.0
Expand Down
2 changes: 2 additions & 0 deletions plugins/jumpcloud/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ github.com/dongri/phonenumber v0.1.12 h1:rR/4VZzxqpocUdyM4dIdfY0TWd8FcW43oiyPaOU
github.com/dongri/phonenumber v0.1.12/go.mod h1:cuHFSstIxh6qh/Qs/SCV3Grb/JMYregBLuXELvSYmT4=
github.com/frankban/quicktest v1.14.6 h1:7Xjx+VpznH+oBnejlPUj8oUpdxnVs4f8XU8WnHkI4W8=
github.com/frankban/quicktest v1.14.6/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
github.com/go-http-utils/headers v0.0.0-20181008091004-fed159eddc2a h1:v6zMvHuY9yue4+QkG/HQ/W67wvtQmWJ4SDo9aK/GIno=
github.com/go-http-utils/headers v0.0.0-20181008091004-fed159eddc2a/go.mod h1:I79BieaU4fxrw4LMXby6q5OS9XnoR9UIKLOzDFjUmuw=
github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
Expand Down
4 changes: 2 additions & 2 deletions plugins/jumpcloud/pkg/app/exec.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package app

import (
"github.com/aserto-dev/ds-load/plugins/jumpcloud/pkg/client"
"github.com/aserto-dev/ds-load/plugins/jumpcloud/pkg/fetch"
"github.com/aserto-dev/ds-load/plugins/jumpcloud/pkg/jc"
"github.com/aserto-dev/ds-load/sdk/common/cc"
"github.com/aserto-dev/ds-load/sdk/exec"
"github.com/aserto-dev/ds-load/sdk/transform"
Expand All @@ -14,7 +14,7 @@ type ExecCmd struct {
}

func (cmd *ExecCmd) Run(ctx *cc.CommonCtx) error {
gClient, err := jc.NewJumpCloudClient(ctx.Context, cmd.APIKey)
gClient, err := client.NewJumpCloudClient(ctx.Context, cmd.APIKey)
if err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions plugins/jumpcloud/pkg/app/fetch.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package app
import (
"os"

"github.com/aserto-dev/ds-load/plugins/jumpcloud/pkg/client"
"github.com/aserto-dev/ds-load/plugins/jumpcloud/pkg/fetch"
"github.com/aserto-dev/ds-load/plugins/jumpcloud/pkg/jc"
"github.com/aserto-dev/ds-load/sdk/common"
"github.com/aserto-dev/ds-load/sdk/common/cc"
)
Expand All @@ -15,7 +15,7 @@ type FetchCmd struct {
}

func (cmd *FetchCmd) Run(ctx *cc.CommonCtx) error {
jcClient, err := jc.NewJumpCloudClient(ctx.Context, cmd.APIKey)
jcClient, err := client.NewJumpCloudClient(ctx.Context, cmd.APIKey)
if err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions plugins/jumpcloud/pkg/app/verify.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package app

import (
"github.com/aserto-dev/ds-load/plugins/jumpcloud/pkg/jc"
"github.com/aserto-dev/ds-load/plugins/jumpcloud/pkg/client"
"github.com/aserto-dev/ds-load/plugins/jumpcloud/pkg/verify"
"github.com/aserto-dev/ds-load/sdk/common/cc"
)
Expand All @@ -11,7 +11,7 @@ type VerifyCmd struct {
}

func (v *VerifyCmd) Run(ctx *cc.CommonCtx) error {
gClient, err := jc.NewJumpCloudClient(ctx.Context, v.APIKey)
gClient, err := client.NewJumpCloudClient(ctx.Context, v.APIKey)
if err != nil {
return err
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package jc
package client

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package jc
package client

const TypeGroup string = "group"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package jc_test
package client_test

import (
"context"
Expand All @@ -7,7 +7,7 @@ import (
"os"
"testing"

"github.com/aserto-dev/ds-load/plugins/jumpcloud/pkg/jc"
"github.com/aserto-dev/ds-load/plugins/jumpcloud/pkg/client"
"github.com/stretchr/testify/require"
)

Expand All @@ -27,7 +27,7 @@ func TestListDirectories(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()

jcc, err := jc.NewJumpCloudClient(ctx, os.Getenv("JC_API_KEY"))
jcc, err := client.NewJumpCloudClient(ctx, os.Getenv("JC_API_KEY"))
require.NoError(t, err)

directories, err := jcc.ListDirectories(ctx)
Expand All @@ -46,7 +46,7 @@ func TestListUsers(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()

jcc, err := jc.NewJumpCloudClient(ctx, os.Getenv("JC_API_KEY"))
jcc, err := client.NewJumpCloudClient(ctx, os.Getenv("JC_API_KEY"))
require.NoError(t, err)

users, err := jcc.ListUsers(ctx)
Expand All @@ -65,10 +65,10 @@ func TestListGroups(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()

jcc, err := jc.NewJumpCloudClient(ctx, os.Getenv("JC_API_KEY"))
jcc, err := client.NewJumpCloudClient(ctx, os.Getenv("JC_API_KEY"))
require.NoError(t, err)

groups, err := jcc.ListGroups(ctx, jc.AllGroups)
groups, err := jcc.ListGroups(ctx, client.AllGroups)
require.NoError(t, err)

enc := json.NewEncoder(os.Stderr)
Expand All @@ -84,10 +84,10 @@ func TestGetSystemGroups(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()

jcc, err := jc.NewJumpCloudClient(ctx, os.Getenv("JC_API_KEY"))
jcc, err := client.NewJumpCloudClient(ctx, os.Getenv("JC_API_KEY"))
require.NoError(t, err)

groups, err := jcc.ListGroups(ctx, jc.SystemGroups)
groups, err := jcc.ListGroups(ctx, client.SystemGroups)
require.NoError(t, err)

enc := json.NewEncoder(os.Stderr)
Expand All @@ -103,10 +103,10 @@ func TestGetUserGroups(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()

jcc, err := jc.NewJumpCloudClient(ctx, os.Getenv("JC_API_KEY"))
jcc, err := client.NewJumpCloudClient(ctx, os.Getenv("JC_API_KEY"))
require.NoError(t, err)

groups, err := jcc.ListGroups(ctx, jc.UserGroups)
groups, err := jcc.ListGroups(ctx, client.UserGroups)
require.NoError(t, err)

enc := json.NewEncoder(os.Stderr)
Expand All @@ -122,18 +122,18 @@ func TestExpandMembersOfGroup(t *testing.T) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()

jcc, err := jc.NewJumpCloudClient(ctx, os.Getenv("JC_API_KEY"))
jcc, err := client.NewJumpCloudClient(ctx, os.Getenv("JC_API_KEY"))
require.NoError(t, err)

users, err := jcc.ListUsers(ctx)
require.NoError(t, err)

idLookup := map[string]*jc.BaseUser{}
idLookup := map[string]*client.BaseUser{}
for _, u := range users {
idLookup[u.ID] = &u.BaseUser
}

groups, err := jcc.ListGroups(ctx, jc.UserGroups)
groups, err := jcc.ListGroups(ctx, client.UserGroups)
require.NoError(t, err)

enc := json.NewEncoder(os.Stderr)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package jc
package client

import "time"

Expand Down
12 changes: 6 additions & 6 deletions plugins/jumpcloud/pkg/fetch/fetch.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ import (
"encoding/json"
"io"

"github.com/aserto-dev/ds-load/plugins/jumpcloud/pkg/jc"
"github.com/aserto-dev/ds-load/plugins/jumpcloud/pkg/client"
"github.com/aserto-dev/ds-load/sdk/common"
"github.com/aserto-dev/ds-load/sdk/common/js"
)

type Fetcher struct {
jcc *jc.JumpCloudClient
jcc *client.JumpCloudClient
Groups bool
}

func New(client *jc.JumpCloudClient) (*Fetcher, error) {
func New(client *client.JumpCloudClient) (*Fetcher, error) {
return &Fetcher{
jcc: client,
}, nil
Expand All @@ -36,7 +36,7 @@ func (f *Fetcher) Fetch(ctx context.Context, outputWriter io.Writer, errorWriter
return err
}

idLookup := map[string]*jc.BaseUser{}
idLookup := map[string]*client.BaseUser{}

for _, user := range users {
userBytes, err := json.Marshal(user)
Expand Down Expand Up @@ -71,9 +71,9 @@ func (f *Fetcher) Fetch(ctx context.Context, outputWriter io.Writer, errorWriter
func (f *Fetcher) fetchGroups(ctx context.Context,
writer *js.JSONArrayWriter,
errorWriter common.ErrorWriter,
idLookup map[string]*jc.BaseUser,
idLookup map[string]*client.BaseUser,
) error {
groups, err := f.jcc.ListGroups(ctx, jc.UserGroups)
groups, err := f.jcc.ListGroups(ctx, client.UserGroups)
if err != nil {
errorWriter.Error(err)
return err
Expand Down
8 changes: 4 additions & 4 deletions plugins/jumpcloud/pkg/verify/verifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ package verify
import (
"context"

"github.com/aserto-dev/ds-load/plugins/jumpcloud/pkg/jc"
"github.com/aserto-dev/ds-load/plugins/jumpcloud/pkg/client"
"github.com/pkg/errors"
)

type Verifier struct {
client *jc.JumpCloudClient
client *client.JumpCloudClient
}

func New(ctx context.Context, client *jc.JumpCloudClient) (*Verifier, error) {
func New(ctx context.Context, client *client.JumpCloudClient) (*Verifier, error) {
return &Verifier{
client: client,
}, nil
Expand All @@ -21,7 +21,7 @@ func (v *Verifier) Verify(ctx context.Context) error {
_, errReq := v.client.ListUsers(ctx)

if errReq != nil {
return errors.Wrap(errReq, "failed to retrieve users from Google")
return errors.Wrap(errReq, "failed to retrieve users from JumpCloud")
}

return nil
Expand Down
6 changes: 4 additions & 2 deletions plugins/keycloak/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ replace github.com/aserto-dev/ds-load/sdk => ../../sdk
require (
github.com/alecthomas/kong v1.10.0
github.com/aserto-dev/ds-load/sdk v0.0.0-20250408143332-e8965667fcc0
github.com/go-http-utils/headers v0.0.0-20181008091004-fed159eddc2a
github.com/golang-jwt/jwt/v5 v5.2.2
github.com/pkg/errors v0.9.1
github.com/samber/lo v1.50.0
github.com/stretchr/testify v1.10.0
google.golang.org/grpc v1.72.0
golang.org/x/oauth2 v0.27.0
)

require (
Expand Down Expand Up @@ -45,6 +46,7 @@ require (
golang.org/x/text v0.25.0 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20250505200425-f936aa4a68b2 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20250505200425-f936aa4a68b2 // indirect
google.golang.org/grpc v1.72.0 // indirect
google.golang.org/protobuf v1.36.6 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading
Loading