Documentation ¶
Index ¶
Constants ¶
View Source
const ( DEFAULT_ACCEPT = "application/json, text/plain, */*" DEFAULT_ACCEPT_LANGUAGE = "en-US,en;q=0.5" DEFAULT_LOGIN_URL = "https://www.vodafone.de/mint/rest/v60/session/start" DEFAULT_TARGET_URL = "" DEFAULT_USER_AGENT = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:121.0) Gecko/20100101 Firefox/121.0" DEFAULT_REFERER = "https://www.vodafone.de/meinvodafone/account/login" OIDC_AUTHORIZE_URL = "https://www.vodafone.de/mint/oidc/authorize" OIDC_RESPONSE_TYPE = "code" OIDC_CLIENT_ID = "b0595a44-0726-11ec-9011-9457a55a403c" OIDC_SCOPES = "openid profile webseal user-groups user-accounts validate-token update-email-username account" OIDC_REDIRECT_URI = "https://www.vodafone.de/meinvodafone/services/" OIDC_CODE_CHALLENGE_METHOD = "S256" OIDC_PROMPT = "none" OIDC_CODE_CHALLENGE_LENGTH = 43 OIDC_TOKEN_URL = "https://www.vodafone.de/mint/oidc/token" OIDC_GRANT_TYPE = "authorization_code" // Hard coded API key in the website of vodafone. This is not a secret. It is used to authenticate the API. // It is highly likely that this can change and needs to be updated after some time. DEFAULT_API_KEY = "aEIoMCae0A933wBL0bLlS6SwSBfkKwM5" )
View Source
const USER_INFO_URL = "https://api.vodafone.de/meinvodafone/v2/user/userInfo"
Variables ¶
View Source
var (
ErrLoginFailed = errors.New("Login failed")
)
View Source
var (
ErrUserInfoRequestFailed = errors.New("user info request failed")
)
Functions ¶
This section is empty.
Types ¶
type ActiveContractCable ¶
type ActiveContractCable struct { ID int `json:"id"` // It is the same as `ID` in `CableSubscription` but as an integer because Vodafone is inconsistent Name string `json:"name"` }
func (*ActiveContractCable) IDString ¶
func (activeContractCable *ActiveContractCable) IDString() string
type CableAccount ¶
type CableSubscription ¶
type LoginData ¶
type LoginData struct { Cookies []*http.Cookie OIDCResponse *OIDCResponse }
func (*LoginData) AuthenticateAPI ¶
type OIDCResponse ¶
type OnlineUser ¶
type OnlineUser struct { MintUserID int `json:"mintUserId"` UserName string `json:"userName"` Title string `json:"title"` FirstName string `json:"firstName"` LastName string `json:"lastName"` LastLoginDate string `json:"lastLoginDate"` PrimaryEmail string `json:"primaryEmail"` EmailValidationStatus string `json:"emailValidationStatus"` IsFirstLogin bool `json:"isFirstLogin"` PermissionFlag bool `json:"permissionFlag"` }
func (*OnlineUser) HumanReadableString ¶
func (onlineUser *OnlineUser) HumanReadableString() string
type UserAccountVBO ¶
type UserAccountVBO struct { AuthLevel string `json:"authLevel"` OnlineUser *OnlineUser `json:"onlineUser,omitempty"` CableAccounts []*CableAccount `json:"cable,omitempty"` ActiveContractCable *ActiveContractCable `json:"activeContractCable,omitempty"` }
func (*UserAccountVBO) GetActiveContractCableID ¶
func (userAccountVBO *UserAccountVBO) GetActiveContractCableID() string
func (*UserAccountVBO) GetAllContractIDs ¶
func (userAccountVBO *UserAccountVBO) GetAllContractIDs() []string
func (*UserAccountVBO) HumanReadableContractTable ¶
func (UserAccountVBO *UserAccountVBO) HumanReadableContractTable() string
func (*UserAccountVBO) HumanReadableString ¶
func (userAccountVBO *UserAccountVBO) HumanReadableString() string
type UserInfo ¶
type UserInfo struct {
UserAccountVBO *UserAccountVBO `json:"userAccountVBO"`
}
func GetUserInfo ¶
func GetUserInfo(bearerToken fetcher.BearerToken) (*UserInfo, error)
func (*UserInfo) GetActiveContractCableID ¶
func (*UserInfo) GetAllContractIDs ¶
func (*UserInfo) HumanReadableString ¶
Click to show internal directories.
Click to hide internal directories.