icloudgo

package module
v0.0.0-...-0b9cdfa Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2022 License: MIT Imports: 11 Imported by: 0

README

iCloud-go

iCloud-go is a Go library to access iCloud.

Inspired by PyiCloud

Warning: This is work in progress.

Documentation

Index

Constants

View Source
const (
	AuthEndpoint  = "https://idmsa.apple.com/appleauth/auth"
	SetupEndpoint = "https://setup.icloud.com/setup/ws/1"
)
View Source
const (
	TwoFactorAuthType = "hsa2"
)

Variables

This section is empty.

Functions

func Login

func Login(ctx context.Context, user string, password, twoFactorCode CredentialFetcher) error

func NewFromCookieFile

func NewFromCookieFile(ctx context.Context, path string) error

Types

type Account

type Account struct {
	ICloudEnv ICloudEnv `json:"iCloudEnv"`
	URL       string    `json:"url"`
	Status    string    `json:"status"`
}

type AccountLoginResponse

type AccountLoginResponse struct {
	DsInfo                       DsInfo      `json:"dsInfo"`
	HasMinimumDeviceForPhotosWeb bool        `json:"hasMinimumDeviceForPhotosWeb"`
	ICDPEnabled                  bool        `json:"iCDPEnabled"`
	Webservices                  Webservices `json:"webservices"`
	PcsEnabled                   bool        `json:"pcsEnabled"`
	ConfigBag                    ConfigBag   `json:"configBag"`
	HsaTrustedBrowser            bool        `json:"hsaTrustedBrowser"`
	AppsOrder                    []string    `json:"appsOrder"`
	Version                      int         `json:"version"`
	IsExtendedLogin              bool        `json:"isExtendedLogin"`
	PcsServiceIdentitiesIncluded bool        `json:"pcsServiceIdentitiesIncluded"`
	HsaChallengeRequired         bool        `json:"hsaChallengeRequired"`
	RequestInfo                  RequestInfo `json:"requestInfo"`
	PcsDeleted                   bool        `json:"pcsDeleted"`
	ICloudInfo                   ICloudInfo  `json:"iCloudInfo"`
	Apps                         Apps        `json:"apps"`
}

type AppleIDEntries

type AppleIDEntries struct {
	IsPrimary bool   `json:"isPrimary"`
	Type      string `json:"type"`
	Value     string `json:"value"`
}

type Apps

type Apps struct {
	Calendar      Calendar      `json:"calendar"`
	Reminders     Reminders     `json:"reminders"`
	Keynote       Keynote       `json:"keynote"`
	Settings      Settings      `json:"settings"`
	Mail          Mail          `json:"mail"`
	Numbers       Numbers       `json:"numbers"`
	Photos        Photos        `json:"photos"`
	Pages         Pages         `json:"pages"`
	Notes3        Notes3        `json:"notes3"`
	Find          Find          `json:"find"`
	Iclouddrive   Iclouddrive   `json:"iclouddrive"`
	Newspublisher Newspublisher `json:"newspublisher"`
	Contacts      Contacts      `json:"contacts"`
}

type Archivews

type Archivews struct {
	URL    string `json:"url"`
	Status string `json:"status"`
}

type BeneficiaryInfo

type BeneficiaryInfo struct {
	IsBeneficiary bool `json:"isBeneficiary"`
}

type Calendar

type Calendar struct {
}

type Ckdatabasews

type Ckdatabasews struct {
	PcsRequired bool   `json:"pcsRequired"`
	URL         string `json:"url"`
	Status      string `json:"status"`
}

type Ckdeviceservice

type Ckdeviceservice struct {
	URL string `json:"url"`
}

type Cksharews

type Cksharews struct {
	URL    string `json:"url"`
	Status string `json:"status"`
}

type ConfigBag

type ConfigBag struct {
	Urls                 Urls `json:"urls"`
	AccountCreateEnabled bool `json:"accountCreateEnabled"`
}

type Contacts

type Contacts struct {
}

type CredentialFetcher

type CredentialFetcher func() (string, error)

type Docws

type Docws struct {
	PcsRequired bool   `json:"pcsRequired"`
	URL         string `json:"url"`
	Status      string `json:"status"`
}

type Drivews

type Drivews struct {
	PcsRequired bool   `json:"pcsRequired"`
	URL         string `json:"url"`
	Status      string `json:"status"`
}

type DsInfo

type DsInfo struct {
	LastName                        string           `json:"lastName"`
	ICDPEnabled                     bool             `json:"iCDPEnabled"`
	TantorMigrated                  bool             `json:"tantorMigrated"`
	Dsid                            string           `json:"dsid"`
	HsaEnabled                      bool             `json:"hsaEnabled"`
	IroncadeMigrated                bool             `json:"ironcadeMigrated"`
	Locale                          string           `json:"locale"`
	BrZoneConsolidated              bool             `json:"brZoneConsolidated"`
	IsManagedAppleID                bool             `json:"isManagedAppleID"`
	IsCustomDomainsFeatureAvailable bool             `json:"isCustomDomainsFeatureAvailable"`
	IsHideMyEmailFeatureAvailable   bool             `json:"isHideMyEmailFeatureAvailable"`
	GilliganInvited                 bool             `json:"gilligan-invited"`
	AppleIDAliases                  []interface{}    `json:"appleIdAliases"`
	HsaVersion                      int              `json:"hsaVersion"`
	UbiquityEOLEnabled              bool             `json:"ubiquityEOLEnabled"`
	IsPaidDeveloper                 bool             `json:"isPaidDeveloper"`
	CountryCode                     string           `json:"countryCode"`
	NotificationID                  string           `json:"notificationId"`
	PrimaryEmailVerified            bool             `json:"primaryEmailVerified"`
	ADsID                           string           `json:"aDsID"`
	Locked                          bool             `json:"locked"`
	HasICloudQualifyingDevice       bool             `json:"hasICloudQualifyingDevice"`
	PrimaryEmail                    string           `json:"primaryEmail"`
	AppleIDEntries                  []AppleIDEntries `json:"appleIdEntries"`
	GilliganEnabled                 bool             `json:"gilligan-enabled"`
	FullName                        string           `json:"fullName"`
	MailFlags                       MailFlags        `json:"mailFlags"`
	LanguageCode                    string           `json:"languageCode"`
	AppleID                         string           `json:"appleId"`
	AnalyticsOptInStatus            bool             `json:"analyticsOptInStatus"`
	FirstName                       string           `json:"firstName"`
	ICloudAppleIDAlias              string           `json:"iCloudAppleIdAlias"`
	NotesMigrated                   bool             `json:"notesMigrated"`
	BeneficiaryInfo                 BeneficiaryInfo  `json:"beneficiaryInfo"`
	HasPaymentInfo                  bool             `json:"hasPaymentInfo"`
	PcsDeleted                      bool             `json:"pcsDeleted"`
	AppleIDAlias                    string           `json:"appleIdAlias"`
	BrMigrated                      bool             `json:"brMigrated"`
	StatusCode                      int              `json:"statusCode"`
	FamilyEligible                  bool             `json:"familyEligible"`
}

type Find

type Find struct {
	CanLaunchWithOneFactor bool `json:"canLaunchWithOneFactor"`
}

type Findme

type Findme struct {
	URL    string `json:"url"`
	Status string `json:"status"`
}

type Geows

type Geows struct {
	URL    string `json:"url"`
	Status string `json:"status"`
}

type ICloudEnv

type ICloudEnv struct {
	ShortID   string `json:"shortId"`
	VipSuffix string `json:"vipSuffix"`
}

type ICloudInfo

type ICloudInfo struct {
	SafariBookmarksHasMigratedToCloudKit bool `json:"SafariBookmarksHasMigratedToCloudKit"`
}

type Iclouddrive

type Iclouddrive struct {
}

type Iwmb

type Iwmb struct {
	URL    string `json:"url"`
	Status string `json:"status"`
}

type Iworkexportws

type Iworkexportws struct {
	URL    string `json:"url"`
	Status string `json:"status"`
}

type Iworkthumbnailws

type Iworkthumbnailws struct {
	URL    string `json:"url"`
	Status string `json:"status"`
}

type Keynote

type Keynote struct {
	IsQualifiedForBeta bool `json:"isQualifiedForBeta"`
}

type Keyvalue

type Keyvalue struct {
	URL    string `json:"url"`
	Status string `json:"status"`
}

type LoginData

type LoginData struct {
	User        `json:",inline"`
	RememberMe  bool     `json:"rememberMe"`
	TrustTokens []string `json:"trustTokens"`
}

type Mail

type Mail struct {
}

type MailFlags

type MailFlags struct {
	IsThreadingAvailable  bool `json:"isThreadingAvailable"`
	IsSearchV2Provisioned bool `json:"isSearchV2Provisioned"`
	IsCKMail              bool `json:"isCKMail"`
}

type Newspublisher

type Newspublisher struct {
	IsHidden bool `json:"isHidden"`
}

type Notes3

type Notes3 struct {
}

type Numbers

type Numbers struct {
	IsQualifiedForBeta bool `json:"isQualifiedForBeta"`
}

type Pages

type Pages struct {
	IsQualifiedForBeta bool `json:"isQualifiedForBeta"`
}

type Photos

type Photos struct {
}

type Photosupload

type Photosupload struct {
	PcsRequired bool   `json:"pcsRequired"`
	URL         string `json:"url"`
	Status      string `json:"status"`
}

type Premiummailsettings

type Premiummailsettings struct {
	URL    string `json:"url"`
	Status string `json:"status"`
}

type Push

type Push struct {
	URL    string `json:"url"`
	Status string `json:"status"`
}

type Reminders

type Reminders struct {
}

type RequestInfo

type RequestInfo struct {
	Country  string `json:"country"`
	TimeZone string `json:"timeZone"`
	Region   string `json:"region"`
}

type Schoolwork

type Schoolwork struct {
}

type Session

type Session struct {
	ClientID       string               `json:"clientID"`
	AccountCountry string               `json:"accountCountry"`
	SessionID      string               `json:"sessionID"`
	SessionToken   string               `json:"sessionToken"`
	TrustToken     string               `json:"trustToken"`
	SCNT           string               `json:"scnt"`
	Data           AccountLoginResponse `json:"data"`
	// contains filtered or unexported fields
}

type Settings

type Settings struct {
	CanLaunchWithOneFactor bool `json:"canLaunchWithOneFactor"`
}

type Sharedlibrary

type Sharedlibrary struct {
	URL    string `json:"url"`
	Status string `json:"status"`
}

type Streams

type Streams struct {
	URL    string `json:"url"`
	Status string `json:"status"`
}

type Ubiquity

type Ubiquity struct {
	URL    string `json:"url"`
	Status string `json:"status"`
}

type Uploadimagews

type Uploadimagews struct {
	URL    string `json:"url"`
	Status string `json:"status"`
}

type Urls

type Urls struct {
	AccountCreateUI     string `json:"accountCreateUI"`
	AccountLoginUI      string `json:"accountLoginUI"`
	AccountLogin        string `json:"accountLogin"`
	AccountRepairUI     string `json:"accountRepairUI"`
	DownloadICloudTerms string `json:"downloadICloudTerms"`
	RepairDone          string `json:"repairDone"`
	AccountAuthorizeUI  string `json:"accountAuthorizeUI"`
	VettingURLForEmail  string `json:"vettingUrlForEmail"`
	AccountCreate       string `json:"accountCreate"`
	GetICloudTerms      string `json:"getICloudTerms"`
	VettingURLForPhone  string `json:"vettingUrlForPhone"`
}

type User

type User struct {
	AccountName string `json:"accountName"`
	Password    string `json:"password"`
}

type WebserviceCalendar

type WebserviceCalendar struct {
	URL    string `json:"url"`
	Status string `json:"status"`
}

type WebserviceContacts

type WebserviceContacts struct {
	URL    string `json:"url"`
	Status string `json:"status"`
}

type WebservicePhotos

type WebservicePhotos struct {
	PcsRequired bool   `json:"pcsRequired"`
	UploadURL   string `json:"uploadUrl"`
	URL         string `json:"url"`
	Status      string `json:"status"`
}

type WebserviceReminders

type WebserviceReminders struct {
	URL    string `json:"url"`
	Status string `json:"status"`
}

type WebserviceSettings

type WebserviceSettings struct {
	URL    string `json:"url"`
	Status string `json:"status"`
}

type Webservices

type Webservices struct {
	Reminders           WebserviceReminders `json:"reminders"`
	Ckdatabasews        Ckdatabasews        `json:"ckdatabasews"`
	Photosupload        Photosupload        `json:"photosupload"`
	Photos              WebservicePhotos    `json:"photos"`
	Drivews             Drivews             `json:"drivews"`
	Uploadimagews       Uploadimagews       `json:"uploadimagews"`
	Schoolwork          Schoolwork          `json:"schoolwork"`
	Cksharews           Cksharews           `json:"cksharews"`
	Findme              Findme              `json:"findme"`
	Ckdeviceservice     Ckdeviceservice     `json:"ckdeviceservice"`
	Iworkthumbnailws    Iworkthumbnailws    `json:"iworkthumbnailws"`
	Calendar            WebserviceCalendar  `json:"calendar"`
	Docws               Docws               `json:"docws"`
	Settings            WebserviceSettings  `json:"settings"`
	Premiummailsettings Premiummailsettings `json:"premiummailsettings"`
	Ubiquity            Ubiquity            `json:"ubiquity"`
	Streams             Streams             `json:"streams"`
	Keyvalue            Keyvalue            `json:"keyvalue"`
	Archivews           Archivews           `json:"archivews"`
	Push                Push                `json:"push"`
	Iwmb                Iwmb                `json:"iwmb"`
	Iworkexportws       Iworkexportws       `json:"iworkexportws"`
	Sharedlibrary       Sharedlibrary       `json:"sharedlibrary"`
	Geows               Geows               `json:"geows"`
	Account             Account             `json:"account"`
	Contacts            WebserviceContacts  `json:"contacts"`
}

Directories

Path Synopsis
internal
test
cli

Jump to

Keyboard shortcuts

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