Documentation
¶
Index ¶
- Constants
- func CacheDir() string
- func Commands() *cli.Command
- func ConfigDir() string
- func ConfigFile() string
- func DeviceFlowLogin(clientID, clientSecret, dc, scopes string) error
- func EnsureAccessToken(config *AuthConfig, forceRefresh bool) (string, error)
- func LoadCachedAccessToken(refreshToken string) (string, time.Time, bool)
- func RefreshAccessToken(config *AuthConfig) (string, error)
- func SaveCachedAccessToken(refreshToken, accessToken string, expiresIn int) error
- func SaveClientConfig(clientID, clientSecret string) error
- func SaveTokens(refreshToken, accessToken string, expiresIn int, ...) error
- func SelfClientExchange(clientID, clientSecret, code, dc, accountsServer string) error
- func TokensFile() string
- type AuthConfig
Constants ¶
View Source
const DefaultScopes = "" +
"ZohoAnalytics.fullaccess.all," +
"ZohoAssist.userapi.READ,ZohoAssist.sessionapi.CREATE,ZohoAssist.unattended.computer.ALL,ZohoAssist.unattended.group.ALL,ZohoAssist.reportapi.READ," +
"ZohoBigin.modules.ALL,ZohoBigin.settings.ALL," +
"zohobackstage.portal.READ,zohobackstage.event.ALL,zohobackstage.agenda.CREATE,zohobackstage.speaker.CREATE,zohobackstage.sponsor.CREATE,zohobackstage.eventticket.CREATE,zohobackstage.order.CREATE,zohobackstage.webhook.CREATE," +
"zohobookings.data.CREATE," +
"ZohoBooks.fullaccess.all," +
"ZohoCampaigns.campaign.ALL,ZohoCampaigns.contact.ALL," +
"ZohoCliq.Webhooks.CREATE,ZohoCliq.Channels.ALL,ZohoCliq.Messages.ALL,ZohoCliq.Chats.ALL,ZohoCliq.Users.ALL,ZohoCliq.Bots.ALL," +
"ZohoCreator.form.CREATE,ZohoCreator.report.ALL,ZohoCreator.meta.form.READ,ZohoCreator.meta.application.READ,ZohoCreator.dashboard.READ," +
"ZohoCRM.modules.ALL,ZohoCRM.settings.ALL,ZohoCRM.users.ALL,ZohoCRM.org.ALL,ZohoCRM.coql.READ,ZohoCRM.bulk.ALL,ZohoCRM.notifications.ALL,ZohoCRM.change_owner.CREATE," +
"Desk.tickets.ALL,Desk.contacts.ALL,Desk.basic.READ,Desk.settings.READ,Desk.search.READ,Desk.accounts.ALL," +
"ZohoExpense.fullaccess.ALL," +
"ZohoInventory.FullAccess.all," +
"ZohoInvoice.fullaccess.all," +
"ZohoLearn.customportal.ALL,ZohoLearn.manual.ALL,ZohoLearn.space.ALL,ZohoLearn.article.ALL,ZohoLearn.attachment.READ,ZohoLearn.attachment.CREATE,ZohoLearn.comment.ALL,ZohoLearn.template.ALL,ZohoLearn.favorite.ALL,ZohoLearn.activity.READ,ZohoLearn.hubMember.READ,ZohoLearn.questionbank.ALL,ZohoLearn.tag.ALL,ZohoLearn.member.CREATE,ZohoLearn.member.UPDATE,ZohoLearn.member.DELETE,ZohoLearn.network.READ,ZohoLearn.commentlike.READ,ZohoLearn.commentlike.CREATE,ZohoLearn.articleimage.READ,ZohoLearn.profile.READ,ZohoLearn.notification.ALL,ZohoLearn.course.ALL,ZohoLearn.quiz.ALL," +
"ZohoMail.accounts.READ,ZohoMail.messages.ALL,ZohoMail.folders.ALL,ZohoMail.tags.ALL,ZohoMail.tasks.ALL,ZohoMail.links.ALL,ZohoMail.notes.ALL,ZohoMail.organization.accounts.ALL,ZohoMail.organization.domains.ALL,ZohoMail.organization.groups.ALL,ZohoMail.organization.policy.ALL,ZohoMail.organization.subscriptions.ALL,ZohoMail.organization.spam.ALL,ZohoMail.organization.audit.READ,ZohoMail.partner.organization.ALL," +
"ZohoMarketingAutomation.campaign.ALL,ZohoMarketingAutomation.lead.ALL,ZohoMarketingAutomation.journey.READ,ZohoMarketingAutomation.journey.CREATE,ZohoMarketingAutomation.wa.READ," +
"ZohoMeeting.meeting.ALL," +
"PageSense.experiments.ALL,PageSense.goals.ALL,PageSense.reports.all,PageSense.customevents.ALL," +
"ZOHOPEOPLE.forms.ALL,ZOHOPEOPLE.employee.ALL,ZOHOPEOPLE.dashboard.ALL,ZOHOPEOPLE.automation.ALL,ZOHOPEOPLE.timetracker.ALL,ZOHOPEOPLE.attendance.ALL,ZOHOPEOPLE.leave.ALL," +
"ZohoProjects.portals.ALL,ZohoProjects.projects.ALL,ZohoProjects.tasks.ALL,ZohoProjects.tasklists.ALL,ZohoProjects.timesheets.ALL,ZohoProjects.bugs.ALL,ZohoProjects.events.ALL,ZohoProjects.forums.ALL,ZohoProjects.milestones.ALL,ZohoProjects.documents.ALL,ZohoProjects.users.ALL,ZohoProjects.projectgroups.ALL,ZohoProjects.tags.ALL,ZohoProjects.leave.ALL,ZohoProjects.teams.ALL,ZohoProjects.status.ALL," +
"ZohoRecruit.modules.ALL,ZohoRecruit.settings.ALL,ZohoRecruit.users.ALL,ZohoRecruit.org.ALL,ZohoRecruit.bulk.ALL,ZohoRecruit.notifications.ALL," +
"SalesIQ.operators.ALL,SalesIQ.portals.ALL,SalesIQ.departments.ALL,SalesIQ.leadscorerules.ALL,SalesIQ.leadscoreconfigs.READ,SalesIQ.criteriafields.READ,SalesIQ.visitorroutingrules.ALL,SalesIQ.chatroutingrules.ALL,SalesIQ.cannedresponses.ALL,SalesIQ.blockedips.ALL,SalesIQ.chatmonitors.ALL,SalesIQ.counts.READ,SalesIQ.visitors.ALL,SalesIQ.feedbacks.READ,SalesIQ.conversations.ALL,SalesIQ.trackingpresets.ALL,SalesIQ.userpreferences.READ,SalesIQ.visitorhistoryviews.ALL,SalesIQ.triggerrules.ALL,SalesIQ.webhooks.ALL,SalesIQ.callbacks.UPDATE,SalesIQ.Apps.ALL,SalesIQ.articles.ALL,SalesIQ.encryptions.CREATE," +
"ZohoSheet.dataAPI.ALL," +
"ZohoShowtime.sessionapi.ALL,ZohoShowtime.talkapi.READ,ZohoShowtime.portalapi.READ," +
"ZohoSign.documents.ALL," +
"ZohoSprints.teams.ALL,ZohoSprints.projects.ALL,ZohoSprints.projectgroups.ALL,ZohoSprints.epic.ALL,ZohoSprints.sprints.ALL,ZohoSprints.items.ALL,ZohoSprints.projectsettings.ALL,ZohoSprints.webhook.ALL,ZohoSprints.meetings.ALL,ZohoSprints.timesheets.ALL,ZohoSprints.release.ALL,ZohoSprints.teamusers.ALL,ZohoSprints.extensions.ALL,ZohoSprints.expense.ALL,ZohoSprints.custommodulerecords.ALL," +
"ZohoSubscriptions.fullaccess.all," +
"ZohoVault.user.ALL,ZohoVault.secrets.ALL," +
"ZohoVoice.agents.ALL,ZohoVoice.telephony.ALL,ZohoVoice.call.ALL,ZohoVoice.powerdialer.ALL,ZohoVoice.sms.ALL," +
"WorkDrive.workspace.ALL,WorkDrive.files.ALL,WorkDrive.files.sharing.ALL,WorkDrive.links.ALL,WorkDrive.team.ALL,WorkDrive.teamfolders.ALL," +
"ZohoWriter.documentEditor.ALL,ZohoPC.files.ALL," +
"ZohoSearch.securesearch.READ"
Variables ¶
This section is empty.
Functions ¶
func ConfigFile ¶
func ConfigFile() string
func DeviceFlowLogin ¶
func EnsureAccessToken ¶
func EnsureAccessToken(config *AuthConfig, forceRefresh bool) (string, error)
func LoadCachedAccessToken ¶
func RefreshAccessToken ¶
func RefreshAccessToken(config *AuthConfig) (string, error)
func SaveCachedAccessToken ¶
func SaveClientConfig ¶
func SaveTokens ¶
func SelfClientExchange ¶
func TokensFile ¶
func TokensFile() string
Types ¶
type AuthConfig ¶
type AuthConfig struct {
ClientID string
ClientSecret string
RefreshToken string
DC string
AccountsURL string
APIDomain string
AccessToken string
ExpiresAt time.Time
Scopes string
Source string
}
func ResolveAuth ¶
func ResolveAuth() (*AuthConfig, error)
func (*AuthConfig) TokenValid ¶
func (c *AuthConfig) TokenValid() bool
Click to show internal directories.
Click to hide internal directories.