Skip to content

Commit

Permalink
Added new methods to filter groups and users in google for better per…
Browse files Browse the repository at this point in the history
…formance
  • Loading branch information
christiangda committed Mar 16, 2021
1 parent 6587be6 commit 1ac0096
Show file tree
Hide file tree
Showing 6 changed files with 435 additions and 55 deletions.
3 changes: 2 additions & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,8 @@ func addFlags(cmd *cobra.Command, cfg *config.Config) {
rootCmd.Flags().StringVarP(&cfg.GoogleAdmin, "google-admin", "u", "", "Google Admin Email")
rootCmd.Flags().StringSliceVar(&cfg.IgnoreUsers, "ignore-users", []string{}, "ignores these users")
rootCmd.Flags().StringSliceVar(&cfg.IgnoreGroups, "ignore-groups", []string{}, "ignores these groups")
rootCmd.Flags().StringVarP(&cfg.GroupMatch, "group-match", "g", ".*", "Regular expression matching groups to sync")
rootCmd.Flags().StringVarP(&cfg.UserMatch, "user-match", "m", "", "user query parameter, example: 'name:John* email:admin*', see: https://developers.google.com/admin-sdk/directory/v1/guides/search-users")
rootCmd.Flags().StringVarP(&cfg.GroupMatch, "group-match", "g", "", "group query parameter, example: 'name:Admin* email:aws-*', see: https://developers.google.com/admin-sdk/directory/v1/guides/search-groups")
}

func logConfig(cfg *config.Config) {
Expand Down
17 changes: 7 additions & 10 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,16 @@ require (
github.com/BurntSushi/toml v0.3.1
github.com/aws/aws-lambda-go v1.17.0
github.com/aws/aws-sdk-go v1.33.7
github.com/golang/mock v1.4.3
github.com/golang/protobuf v1.4.1 // indirect
github.com/golang/mock v1.5.0
github.com/hashicorp/go-retryablehttp v0.6.7
github.com/pkg/errors v0.9.1
github.com/sirupsen/logrus v1.2.0
github.com/spf13/cobra v1.0.0
github.com/spf13/viper v1.4.0
github.com/stretchr/testify v1.5.1
golang.org/x/net v0.0.0-20200505041828-1ed23360d12c // indirect
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d
golang.org/x/sys v0.0.0-20200501145240-bc7a7d42d5c3 // indirect
google.golang.org/api v0.24.0
google.golang.org/appengine v1.6.6 // indirect
google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84 // indirect
google.golang.org/grpc v1.29.1 // indirect
github.com/stretchr/testify v1.6.1
golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4 // indirect
golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84
golang.org/x/sys v0.0.0-20210316164454-77fc1eacc6aa // indirect
google.golang.org/api v0.42.0
google.golang.org/genproto v0.0.0-20210315173758-2651cd453018 // indirect
)
Loading

0 comments on commit 1ac0096

Please sign in to comment.