CLI for SendGrid, which helps in managing SSO users, can install and update users from yaml config

Sendgrid API

This script is needed to add new users to SendGrid as SSO teammates. Previously, all users were manually added and manually migrating them would take a long time.

Preparation for run script

Users config

Update users in conf.yaml file, add the user to one of three groups, they all differ in access rights.

groups:
  - admin:
    users:
      - email: [email protected]
        first_name: Zack
        last_name: Yo
    scopes: []
  - developer:
    users:
      - email: [email protected]
        first_name: Nik
        last_name: Nilson
    scopes: []
  - support:
    users:
      - email: [email protected]
        first_name: Vladimir
        last_name: Nikolaev
    scopes: []
Build
env GO111MODULE=on go build -o sg-users-sso -v
Run
Create all users:
env SENDGRID_API_KEY="xxx" ./sg-users-sso --create

Update all users:
env SENDGRID_API_KEY="xxx" ./sg-users-sso --update

Get all no SSO users:
env SENDGRID_API_KEY="xxx" ./sg-users-sso --get-all-no-sso

Get all users:
env SENDGRID_API_KEY="xxx" ./sg-users-sso --get-all

See help:
./sg-users-sso --help

Also you can use --sendgrid-token for setting SENDGRID_API_KEY

./sg-users-sso --get-all --sendgrid-token="xxx"
Available flags:
      --config-path string      Config file path (default "config/users.yaml")
  -c, --create                  Create all users
  -a, --get-all                 Get all users
  -n, --get-all-no-sso          Get all no SSO users
  -t, --sendgrid-token string   Config file path, default env: SENDGRID_API_KEY
  -u, --update                  Update all users

Access scopes:

Due to the fact that SendGrid does not support groups, you have to manage separate scopes. You must grant the necessary permissions to each group, all available scopes are in the file config/users.yaml

  1. admin group (access to all scopes);
  2. developers group;
  3. support group.

Licence

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Similar Resources

Dapper is a CLI toolkit for compiling, deploying, and managing Algorand applications

🕴️ Dapper Decentralized Application Manager for the Algorand Blockchain Dappman is a Golang CLI toolkit for compiling, deploying, and managing Algora

Feb 11, 2022

dots is CLI tool to build, version and publish config file bundles.

dots-cli dots is CLI tool to build, version and publish config file bundles. TODO (shared): Writing comprehensive documentation Designing landing page

Aug 24, 2022

Nebula Diagnosis CLI Tool is an information diagnosis cli tool for the nebula service and the node to which the service belongs.

Nebula Diagnosis CLI Tool is an information diagnosis cli tool for the nebula service and the node to which the service belongs.

Jan 12, 2022

It is an easy and fast tool to install your packages with just one command.

Trouxa It is an easy and fast tool to install your packages with just one command. What means "Trouxa"? In portuguese, Trouxa means something like a "

Sep 29, 2022

Download and install binaries from GitHub Releases, interactively.

bget Download and install binary files from GitHub Releases. Preview Install For Mac/Linux users, you can use Homebrew to install it: brew install ego

Aug 24, 2022

Issue-mafia - An out-of-the-box CLI that helps you to easily synchronize Git hooks with a remote repository

issue-mafia is an out-of-the-box CLI that helps you to easily synchronize Git hooks with a remote repository.

Feb 14, 2022

News-parser-cli - Simple CLI which allows you to receive news depending on the parameters passed to it

News-parser-cli - Simple CLI which allows you to receive news depending on the parameters passed to it

news-parser-cli Simple CLI which allows you to receive news depending on the par

Jan 4, 2022

Command not found? Install it right there!

Command not found? Install it right there!

Tii On most GNU/Linux systems, when a command is not found, a message showing what can be run to install the command is printed.

Aug 10, 2022

A command tool to help user install oh-my-zsh plugins fast in a comfortable way

zshx A command tool to help user install oh-my-zsh plugins fast in a comfortable way. in other way, it is a zsh plugin package manager. How to use the

Feb 11, 2022
Comments
  • Bump github.com/sirupsen/logrus from 1.8.1 to 1.9.0

    Bump github.com/sirupsen/logrus from 1.8.1 to 1.9.0

    Bumps github.com/sirupsen/logrus from 1.8.1 to 1.9.0.

    Commits
    • f8bf765 Merge pull request #1343 from sirupsen/dbd-upd-dep
    • ebc9029 update dependencies
    • 56c843c Merge pull request #1337 from izhakmo/fix-cve
    • 41b4ee6 update gopkg.in/yaml.v3 to v3.0.1
    • f98ed3e Merge pull request #1333 from nathanejohnson/bumpxsys
    • 2b8f60a bump version of golangci-lint
    • 0db10ef bump version of golang.org/x/sys dependency
    • 85981c0 Merge pull request #1263 from rubensayshi/fix-race
    • 79c5ab6 Merge pull request #1283 from sirupsen/dbd-log-doc
    • 5f8c666 Improve Log methods documentation
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • Bump github.com/sendgrid/sendgrid-go from 3.10.0+incompatible to 3.11.1+incompatible

    Bump github.com/sendgrid/sendgrid-go from 3.10.0+incompatible to 3.11.1+incompatible

    Bumps github.com/sendgrid/sendgrid-go from 3.10.0+incompatible to 3.11.1+incompatible.

    Release notes

    Sourced from github.com/sendgrid/sendgrid-go's releases.

    v3.11.1

    Release Notes

    Library - Chore

    v3.11.0

    Release Notes

    Library - Feature

    Library - Docs

    Library - Chore

    v3.10.5

    Release Notes

    Library - Chore

    v3.10.4

    Release Notes

    Library - Chore

    v3.10.3

    Release Notes

    Library - Docs

    v3.10.2

    Release Notes

    Library - Chore

    v3.10.1

    Release Notes

    Library - Chore

    Commits
    • 237c26e Release v3.11.1
    • d14424f [Librarian] Version Bump
    • 542c69c chore: push Datadog Release Metric upon deploy success (#456)
    • 1101132 Release v3.11.0
    • 04025b0 [Librarian] Version Bump
    • 5746b4b feat: Refactor Inbound package to provide access to SendGrid's pre-processing...
    • 9966585 docs: add docs for bypass mail options (#454)
    • 33a4524 chore: upgrade supported language versions (#453)
    • 426cd9d fix: only do a Docker Login if the secrets are available
    • c609091 chore: make Slack message consistent across all repos
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
  • Bump github.com/sendgrid/sendgrid-go from 3.11.1+incompatible to 3.12.0+incompatible

    Bump github.com/sendgrid/sendgrid-go from 3.11.1+incompatible to 3.12.0+incompatible

    Bumps github.com/sendgrid/sendgrid-go from 3.11.1+incompatible to 3.12.0+incompatible.

    Release notes

    Sourced from github.com/sendgrid/sendgrid-go's releases.

    v3.12.0

    Release Notes

    Library - Feature

    Library - Test

    Library - Docs

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
Gostall - Run go install ./cmd/server and not have the binary install in your GOBIN be called server?

GOSTALL Ever wanted to run go install ./cmd/server and not have the binary insta

Jan 7, 2022
Query, update and convert data structures from the command line. Comparable to jq/yq but supports JSON, TOML, YAML, XML and CSV with zero runtime dependencies.
Query, update and convert data structures from the command line. Comparable to jq/yq but supports JSON, TOML, YAML, XML and CSV with zero runtime dependencies.

dasel Dasel (short for data-selector) allows you to query and modify data structures using selector strings. Comparable to jq / yq, but supports JSON,

Jan 2, 2023
Opinionated CLI app for AWS SSO made in Golang!
Opinionated CLI app for AWS SSO made in Golang!

aws-sso-creds AWS SSO Creds Table of Contents About The Project Built With Instalation Static From source Usage Contributing License Contact Acknowled

Aug 17, 2022
K-Mesh is an experimental Knative distribution which provides a fresh, CLI-focused, holistic user experience of running and managing Knative.

K-Mesh is an experimental Knative distribution which provides a fresh, CLI-focused, holistic user experience of running and managing Knative. N

Feb 14, 2022
CraftTalk Command Line Tool helps with managing CraftTalk releases on baremetal instances

ctcli - CraftTalk Command Line Tool Commands help Shows help version Shows version init Initializes specified root directory as a ctcli dir. ctcli --r

Jan 20, 2022
A CLI tool which loads data from yaml files into the Google Cloud Spanner tables

splanter A CLI tool which loads data from yaml files into the Google Cloud Spanner tables (mainly for the development).

Oct 27, 2022
Declarative CLI Version manager. Support Lazy Install and Sharable configuration mechanism named Registry. Switch versions seamlessly

aqua Declarative CLI Version manager. Support Lazy Install and Sharable configuration mechanism named Registry. Switch versions seamlessly. Index Slid

Dec 29, 2022
yq lets you read YAML files easily on the terminal. You can find key/values easily
yq lets you read YAML files easily on the terminal. You can find key/values easily

yq yq lets you read YAML files easily on the terminal. You can find key/values easily. Motivation Reading yaml configurations for k8s file becomes ard

Nov 2, 2021
A simple CLI app to update dynamic DNS settings for your CloudFlare account

Cloudflare Dynamic DNS Updater (Go) written by Darren Rambaud Why? A simple CLI app to update dynamic DNS settings for your CloudFlare account. Useful

Nov 28, 2021
GitHub CLI extension to clone (or update) all repositories in an Organization, with the ability to filter via search queries.

gh-org-repo-sync GitHub CLI extension to clone all repositories in an Organization, with the ability to filter via search queries. If a local clone al

Nov 2, 2022