sendgrid

package
v3.83.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2024 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

Code generated by go generate; DO NOT EDIT.

Index

Constants

This section is empty.

Variables

View Source
var (
	PermissionStrings = map[Permission]string{}/* 187 elements not displayed */

	StringToPermission = map[string]Permission{}/* 187 elements not displayed */

	PermissionIDs = map[Permission]int{}/* 187 elements not displayed */

	IdToPermission = map[int]Permission{}/* 187 elements not displayed */

)
View Source
var SCOPES = []SendgridScope{

	{Category: "Billing", Prefixes: []string{"billing"}},

	{Category: "API Keys", Prefixes: []string{"api_keys"}},
	{Category: "Alerts", Prefixes: []string{"alerts"}},
	{Category: "Category Management", Prefixes: []string{"categories"}},
	{Category: "Design Library", Prefixes: []string{"design_library"}},
	{Category: "Email Activity", Prefixes: []string{"messages"}},
	{Category: "Email Testing", Prefixes: []string{"email_testing"}},
	{Category: "IP Management", Prefixes: []string{"ips"}},
	{Category: "Inbound Parse", Prefixes: []string{"user.webhooks.parse.settings"}},
	{Category: "Mail Send", SubCategory: "Mail Send", Prefixes: []string{"mail.send"}},
	{Category: "Mail Send", SubCategory: "Scheduled Sends", Prefixes: []string{"user.scheduled_sends, mail.batch"}},
	{Category: "Mail Settings", SubCategory: "Address Allow List", Prefixes: []string{"mail_settings.address_whitelist"}},
	{Category: "Mail Settings", SubCategory: "BCC", Prefixes: []string{"mail_settings.bcc"}},
	{Category: "Mail Settings", SubCategory: "Bounce Purge", Prefixes: []string{"mail_settings.bounce_purge"}},
	{Category: "Mail Settings", SubCategory: "Event Notification", Prefixes: []string{"user.webhooks.event"}},
	{Category: "Mail Settings", SubCategory: "Footer", Prefixes: []string{"mail_settings.footer"}},
	{Category: "Mail Settings", SubCategory: "Forward Bounce", Prefixes: []string{"mail_settings.forward_bounce"}},
	{Category: "Mail Settings", SubCategory: "Forward Spam", Prefixes: []string{"mail_settings.forward_spam"}},
	{Category: "Mail Settings", SubCategory: "Legacy Email Template", Prefixes: []string{"mail_settings.template"}},
	{Category: "Mail Settings", SubCategory: "Plain Content", Prefixes: []string{"mail_settings.plain_content"}},
	{Category: "Mail Settings", SubCategory: "Spam Checker", Prefixes: []string{"mail_settings.spam_check"}},
	{Category: "Marketing", SubCategory: "Automation", Prefixes: []string{"marketing.automation"}},
	{Category: "Marketing", SubCategory: "Marketing", Prefixes: []string{"marketing.read"}},
	{Category: "Partners", Prefixes: []string{"partner_settings"}},
	{Category: "Recipients Data Erasure", Prefixes: []string{"recipients"}},
	{Category: "Security", Prefixes: []string{"access_settings"}},
	{Category: "Sender Authentication", Prefixes: []string{"whitelabel"}},
	{Category: "Stats", SubCategory: "Browser Stats", Prefixes: []string{"browsers"}},
	{Category: "Stats", SubCategory: "Category Stats", Prefixes: []string{"categories.stats"}},
	{Category: "Stats", SubCategory: "Email Clients and Devices", Prefixes: []string{"clients", "devices"}},
	{Category: "Stats", SubCategory: "Geographical", Prefixes: []string{"geo"}},
	{Category: "Stats", SubCategory: "Global Stats", Prefixes: []string{"stats.global"}},
	{Category: "Stats", SubCategory: "Mailbox Provider Stats", Prefixes: []string{"mailbox_providers"}},
	{Category: "Stats", SubCategory: "Parse Webhook", Prefixes: []string{"user.webhooks.parse.stats"}},
	{Category: "Stats", SubCategory: "Stats Overview", Prefixes: []string{"stats.read"}},
	{Category: "Stats", SubCategory: "Subuser Stats", Prefixes: []string{"subusers"}},
	{Category: "Suppressions", SubCategory: "Supressions", Prefixes: []string{"suppression"}},
	{Category: "Suppressions", SubCategory: "Unsubscribe Groups", Prefixes: []string{"asm.groups"}},
	{Category: "Template Engine", Prefixes: []string{"templates"}},
	{Category: "Tracking", SubCategory: "Click Tracking", Prefixes: []string{"tracking_settings.click"}},
	{Category: "Tracking", SubCategory: "Google Analytics", Prefixes: []string{"tracking_settings.google_analytics"}},
	{Category: "Tracking", SubCategory: "Open Tracking", Prefixes: []string{"tracking_settings.open"}},
	{Category: "Tracking", SubCategory: "Subscription Tracking", Prefixes: []string{"tracking_settings.subscription"}},
	{Category: "User Account", SubCategory: "Enforced TLS", Prefixes: []string{"user.settings.enforced_tls"}},
	{Category: "User Account", SubCategory: "Timezone", Prefixes: []string{"user.timezone"}},

	{Category: "Suppressions", SubCategory: "Unsubscribe Group Suppressions", Prefixes: []string{"asm.groups.suppressions"}},
	{Category: "Suppressions", SubCategory: "Global Suppressions", Prefixes: []string{"asm.suppressions.global"}},
	{Category: "Credentials", Prefixes: []string{"credentials"}},
	{Category: "Mail Settings", Prefixes: []string{"mail_settings"}},
	{Category: "Signup", Prefixes: []string{"signup"}},
	{Category: "Suppressions", SubCategory: "Blocks", Prefixes: []string{"suppression.blocks"}},
	{Category: "Suppressions", SubCategory: "Bounces", Prefixes: []string{"suppression.bounces"}},
	{Category: "Suppressions", SubCategory: "Invalid Emails", Prefixes: []string{"suppression.invalid_emails"}},
	{Category: "Suppressions", SubCategory: "Spam Reports", Prefixes: []string{"suppression.spam_reports"}},
	{Category: "Suppressions", SubCategory: "Unsubscribes", Prefixes: []string{"suppression.unsubscribes"}},
	{Category: "Teammates", Prefixes: []string{"teammates"}},
	{Category: "Tracking", Prefixes: []string{"tracking_settings"}},
	{Category: "UI", Prefixes: []string{"ui"}},
	{Category: "User Account", SubCategory: "Account", Prefixes: []string{"user.account"}},
	{Category: "User Account", SubCategory: "Credits", Prefixes: []string{"user.credits"}},
	{Category: "User Account", SubCategory: "Email", Prefixes: []string{"user.email"}},
	{Category: "User Account", SubCategory: "Multifactor Authentication", Prefixes: []string{"user.multifactor_authentication"}},
	{Category: "User Account", SubCategory: "Password", Prefixes: []string{"user.password"}},
	{Category: "User Account", SubCategory: "Profile", Prefixes: []string{"user.profile"}},
	{Category: "User Account", SubCategory: "Username", Prefixes: []string{"user.username"}},
}

Functions

func AnalyzeAndPrintPermissions added in v3.80.5

func AnalyzeAndPrintPermissions(cfg *config.Config, key string)

Types

type Analyzer added in v3.82.0

type Analyzer struct {
	Cfg *config.Config
}

func (Analyzer) Analyze added in v3.82.0

func (a Analyzer) Analyze(_ context.Context, credInfo map[string]string) (*analyzers.AnalyzerResult, error)

func (Analyzer) Type added in v3.82.0

type Permission added in v3.82.0

type Permission int
const (
	Invalid                               Permission = iota
	AccessSettingsActivityRead            Permission = iota
	AccessSettingsWhitelistCreate         Permission = iota
	AccessSettingsWhitelistDelete         Permission = iota
	AccessSettingsWhitelistRead           Permission = iota
	AccessSettingsWhitelistUpdate         Permission = iota
	AlertsCreate                          Permission = iota
	AlertsDelete                          Permission = iota
	AlertsRead                            Permission = iota
	AlertsUpdate                          Permission = iota
	ApiKeysCreate                         Permission = iota
	ApiKeysDelete                         Permission = iota
	ApiKeysRead                           Permission = iota
	ApiKeysUpdate                         Permission = iota
	AsmGroupsCreate                       Permission = iota
	AsmGroupsDelete                       Permission = iota
	AsmGroupsRead                         Permission = iota
	AsmGroupsUpdate                       Permission = iota
	BillingCreate                         Permission = iota
	BillingDelete                         Permission = iota
	BillingRead                           Permission = iota
	BillingUpdate                         Permission = iota
	BrowsersStatsRead                     Permission = iota
	CategoriesCreate                      Permission = iota
	CategoriesDelete                      Permission = iota
	CategoriesRead                        Permission = iota
	CategoriesStatsRead                   Permission = iota
	CategoriesStatsSumsRead               Permission = iota
	CategoriesUpdate                      Permission = iota
	ClientsDesktopStatsRead               Permission = iota
	ClientsPhoneStatsRead                 Permission = iota
	ClientsStatsRead                      Permission = iota
	ClientsTabletStatsRead                Permission = iota
	ClientsWebmailStatsRead               Permission = iota
	DevicesStatsRead                      Permission = iota
	EmailActivityRead                     Permission = iota
	GeoStatsRead                          Permission = iota
	IpsAssignedRead                       Permission = iota
	IpsPoolsCreate                        Permission = iota
	IpsPoolsDelete                        Permission = iota
	IpsPoolsIpsCreate                     Permission = iota
	IpsPoolsIpsDelete                     Permission = iota
	IpsPoolsIpsRead                       Permission = iota
	IpsPoolsIpsUpdate                     Permission = iota
	IpsPoolsRead                          Permission = iota
	IpsPoolsUpdate                        Permission = iota
	IpsRead                               Permission = iota
	IpsWarmupCreate                       Permission = iota
	IpsWarmupDelete                       Permission = iota
	IpsWarmupRead                         Permission = iota
	IpsWarmupUpdate                       Permission = iota
	MailSettingsAddressWhitelistRead      Permission = iota
	MailSettingsAddressWhitelistUpdate    Permission = iota
	MailSettingsBouncePurgeRead           Permission = iota
	MailSettingsBouncePurgeUpdate         Permission = iota
	MailSettingsFooterRead                Permission = iota
	MailSettingsFooterUpdate              Permission = iota
	MailSettingsForwardBounceRead         Permission = iota
	MailSettingsForwardBounceUpdate       Permission = iota
	MailSettingsForwardSpamRead           Permission = iota
	MailSettingsForwardSpamUpdate         Permission = iota
	MailSettingsPlainContentRead          Permission = iota
	MailSettingsPlainContentUpdate        Permission = iota
	MailSettingsRead                      Permission = iota
	MailSettingsTemplateRead              Permission = iota
	MailSettingsTemplateUpdate            Permission = iota
	MailBatchCreate                       Permission = iota
	MailBatchDelete                       Permission = iota
	MailBatchRead                         Permission = iota
	MailBatchUpdate                       Permission = iota
	MailSend                              Permission = iota
	MailboxProvidersStatsRead             Permission = iota
	MarketingCampaignsCreate              Permission = iota
	MarketingCampaignsDelete              Permission = iota
	MarketingCampaignsRead                Permission = iota
	MarketingCampaignsUpdate              Permission = iota
	PartnerSettingsNewRelicRead           Permission = iota
	PartnerSettingsNewRelicUpdate         Permission = iota
	PartnerSettingsRead                   Permission = iota
	StatsGlobalRead                       Permission = iota
	StatsRead                             Permission = iota
	SubusersCreate                        Permission = iota
	SubusersCreditsCreate                 Permission = iota
	SubusersCreditsDelete                 Permission = iota
	SubusersCreditsRead                   Permission = iota
	SubusersCreditsRemainingCreate        Permission = iota
	SubusersCreditsRemainingDelete        Permission = iota
	SubusersCreditsRemainingRead          Permission = iota
	SubusersCreditsRemainingUpdate        Permission = iota
	SubusersCreditsUpdate                 Permission = iota
	SubusersDelete                        Permission = iota
	SubusersMonitorCreate                 Permission = iota
	SubusersMonitorDelete                 Permission = iota
	SubusersMonitorRead                   Permission = iota
	SubusersMonitorUpdate                 Permission = iota
	SubusersRead                          Permission = iota
	SubusersReputationsRead               Permission = iota
	SubusersStatsMonthlyRead              Permission = iota
	SubusersStatsRead                     Permission = iota
	SubusersStatsSumsRead                 Permission = iota
	SubusersSummaryRead                   Permission = iota
	SubusersUpdate                        Permission = iota
	SuppressionBlocksCreate               Permission = iota
	SuppressionBlocksDelete               Permission = iota
	SuppressionBlocksRead                 Permission = iota
	SuppressionBlocksUpdate               Permission = iota
	SuppressionBouncesCreate              Permission = iota
	SuppressionBouncesDelete              Permission = iota
	SuppressionBouncesRead                Permission = iota
	SuppressionBouncesUpdate              Permission = iota
	SuppressionCreate                     Permission = iota
	SuppressionDelete                     Permission = iota
	SuppressionInvalidEmailsCreate        Permission = iota
	SuppressionInvalidEmailsDelete        Permission = iota
	SuppressionInvalidEmailsRead          Permission = iota
	SuppressionInvalidEmailsUpdate        Permission = iota
	SuppressionRead                       Permission = iota
	SuppressionSpamReportsCreate          Permission = iota
	SuppressionSpamReportsDelete          Permission = iota
	SuppressionSpamReportsRead            Permission = iota
	SuppressionSpamReportsUpdate          Permission = iota
	SuppressionUnsubscribesCreate         Permission = iota
	SuppressionUnsubscribesDelete         Permission = iota
	SuppressionUnsubscribesRead           Permission = iota
	SuppressionUnsubscribesUpdate         Permission = iota
	SuppressionUpdate                     Permission = iota
	TeammatesCreate                       Permission = iota
	TeammatesRead                         Permission = iota
	TeammatesUpdate                       Permission = iota
	TeammatesDelete                       Permission = iota
	TemplatesCreate                       Permission = iota
	TemplatesDelete                       Permission = iota
	TemplatesRead                         Permission = iota
	TemplatesUpdate                       Permission = iota
	TemplatesVersionsActivateCreate       Permission = iota
	TemplatesVersionsActivateDelete       Permission = iota
	TemplatesVersionsActivateRead         Permission = iota
	TemplatesVersionsActivateUpdate       Permission = iota
	TemplatesVersionsCreate               Permission = iota
	TemplatesVersionsDelete               Permission = iota
	TemplatesVersionsRead                 Permission = iota
	TemplatesVersionsUpdate               Permission = iota
	TrackingSettingsClickRead             Permission = iota
	TrackingSettingsClickUpdate           Permission = iota
	TrackingSettingsGoogleAnalyticsRead   Permission = iota
	TrackingSettingsGoogleAnalyticsUpdate Permission = iota
	TrackingSettingsOpenRead              Permission = iota
	TrackingSettingsOpenUpdate            Permission = iota
	TrackingSettingsRead                  Permission = iota
	TrackingSettingsSubscriptionRead      Permission = iota
	TrackingSettingsSubscriptionUpdate    Permission = iota
	UserAccountRead                       Permission = iota
	UserCreditsRead                       Permission = iota
	UserEmailCreate                       Permission = iota
	UserEmailDelete                       Permission = iota
	UserEmailRead                         Permission = iota
	UserEmailUpdate                       Permission = iota
	UserMultifactorAuthenticationCreate   Permission = iota
	UserMultifactorAuthenticationDelete   Permission = iota
	UserMultifactorAuthenticationRead     Permission = iota
	UserMultifactorAuthenticationUpdate   Permission = iota
	UserPasswordRead                      Permission = iota
	UserPasswordUpdate                    Permission = iota
	UserProfileRead                       Permission = iota
	UserProfileUpdate                     Permission = iota
	UserScheduledSendsCreate              Permission = iota
	UserScheduledSendsDelete              Permission = iota
	UserScheduledSendsRead                Permission = iota
	UserScheduledSendsUpdate              Permission = iota
	UserSettingsEnforcedTlsRead           Permission = iota
	UserSettingsEnforcedTlsUpdate         Permission = iota
	UserTimezoneRead                      Permission = iota
	UserUsernameRead                      Permission = iota
	UserUsernameUpdate                    Permission = iota
	UserWebhooksEventSettingsRead         Permission = iota
	UserWebhooksEventSettingsUpdate       Permission = iota
	UserWebhooksEventTestCreate           Permission = iota
	UserWebhooksEventTestRead             Permission = iota
	UserWebhooksEventTestUpdate           Permission = iota
	UserWebhooksParseSettingsCreate       Permission = iota
	UserWebhooksParseSettingsDelete       Permission = iota
	UserWebhooksParseSettingsRead         Permission = iota
	UserWebhooksParseSettingsUpdate       Permission = iota
	UserWebhooksParseStatsRead            Permission = iota
	WhitelabelCreate                      Permission = iota
	WhitelabelDelete                      Permission = iota
	WhitelabelRead                        Permission = iota
	WhitelabelUpdate                      Permission = iota
)

func PermissionFromID added in v3.82.0

func PermissionFromID(id int) (Permission, error)

PermissionFromID converts an ID to its Permission enum

func PermissionFromString added in v3.82.0

func PermissionFromString(s string) (Permission, error)

PermissionFromString converts a string representation to its Permission enum

func (Permission) ToID added in v3.82.0

func (p Permission) ToID() (int, error)

ToID converts a Permission enum to its ID

func (Permission) ToString added in v3.82.0

func (p Permission) ToString() (string, error)

ToString converts a Permission enum to its string representation

type ScopesJSON

type ScopesJSON struct {
	Scopes []string `json:"scopes"`
}

type SecretInfo added in v3.80.5

type SecretInfo struct {
	RawScopes []string
	Scopes    []SendgridScope
}

func AnalyzePermissions

func AnalyzePermissions(cfg *config.Config, key string) (*SecretInfo, error)

type SendgridScope

type SendgridScope struct {
	Category       string
	SubCategory    string
	Prefixes       []string // Prefixes for the scope
	Permissions    []string
	PermissionType analyzers.PermissionType
}

func (*SendgridScope) AddPermission

func (s *SendgridScope) AddPermission(permission string)

func (*SendgridScope) RunTests

func (s *SendgridScope) RunTests()

Jump to

Keyboard shortcuts

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