gsuite

package
v0.10.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 15, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

README

G-Suite

Usage

source:
  scope: my-scope
  type: gsuite
  config:
    service_account_json: "XXX"
    user_email: meteor@raystack.com

Inputs

Key Value Example Description
user_email string meteor@raystack.com User email authorized to access the APIs required
service_account_json string {"type": "service_account","project_id": "XXXXXX","private_key_id": "XXXXXX","private_key": "XXXXXX","client_email": "XXXXXX","client_id": "XXXXXX","auth_uri": "https://accounts.google.com/o/oauth2/auth","token_uri": "https://oauth2.googleapis.com/token","auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs","client_x509_cert_url": "XXXXXX"} Service Account JSON object required

Outputs

Field Sample Value
email doe.john@gmail.com
full_name Jon Doe
status suspended
attributes {"aliases":"john.doe@raystack.com","custom_schemas":{},
"org_unit_path":"/","organizations":
[{"costCenter": "raystack"}],
"relations":[{"type":"manager",
"value":"john.lee@raystack.com"}]}
Notes
  • The service account must have a delegated domain wide authority
  • User Email : Only users with access to the Admin APIs can access the Admin SDK Directory API, therefore your service account needs to impersonate one of those users to access the Admin SDK Directory API.

Contributing

Refer to the contribution guidelines for information on contributing to this module.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ServiceAccountJSON string `json:"service_account_json" yaml:"service_account_json" mapstructure:"service_account_json" validate:"required"`
	UserEmail          string `json:"user_email" yaml:"user_email" mapstructure:"user_email" validate:"required"`
}

type DefaultUsersServiceFactory

type DefaultUsersServiceFactory struct{}

func (*DefaultUsersServiceFactory) BuildUserService

func (f *DefaultUsersServiceFactory) BuildUserService(ctx context.Context, email, serviceAccountJSON string) (UsersListCall, error)

type Extractor

type Extractor struct {
	plugins.BaseExtractor
	// contains filtered or unexported fields
}

Extractor manages the extraction of data from the extractor

func New

func New(logger log.Logger, userServiceFactory UsersServiceFactory) *Extractor

New returns a pointer to an initialized Extractor Object

func (*Extractor) Extract

func (e *Extractor) Extract(ctx context.Context, emit plugins.Emit) (err error)

Extract extracts the data from the extractor The data is returned as a list of assets.Asset

func (*Extractor) Init

func (e *Extractor) Init(ctx context.Context, config plugins.Config) (err error)

Init initializes the extractor

type UsersListCall

type UsersListCall interface {
	Do(opts ...googleapi.CallOption) (*admin.Users, error)
}

type UsersServiceFactory

type UsersServiceFactory interface {
	BuildUserService(ctx context.Context, email, serviceAccountJSON string) (UsersListCall, error)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL