protocol

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultUserAgent = "android:com.ringapp"
	RingClientID     = "ring_official_android"
	RingScope        = "client"
)
View Source
const (
	APIBaseURL         = "https://api.ring.com"
	OAuthBaseURL       = "https://oauth.ring.com"
	USSolutionsBaseURL = "https://prd-api-us.prd.rings.solutions"
	// #nosec G101 -- endpoint path, not credential material.
	OAuthTokenPath                = "/oauth/token"
	OAuthAuthorizePath            = "/oauth/v2/authorize"
	OAuthSigninPath               = "/oauth/v2/signin"
	TicketPath                    = "/api/v1/clap/ticket/request/signalsocket"
	DevicesV3Path                 = "/device_info/v3/devices"
	DeviceDetailV3Path            = "/device_info/v3/devices/{device_id}"
	LocationListV3Path            = "/location_info/v3/locations"
	LocationDetailV4Path          = "/location_info/v4/locations/{location_id}"
	LocationGroupsPath            = "/groups/v1/locations/{location_id}/groups"
	LocationDevicesPath           = "/groups/v1/locations/{location_id}/devices"
	DeviceTimelinePath            = "/evm/v2/timeline/devices/{device_id}"
	HistoryDevicesPath            = "/evm/v3/history/devices"
	CapturedTicketsPath           = "/api/v1/clap/tickets"
	DeviceCommandPath             = "/commands/v1/devices/{device_id}"
	IntercomUnlockPath            = "/commands/v1/devices/{device_id}/device_rpc"
	PushDeviceRegistrationPath    = "/clients_api/device"
	DeviceDingSubscribePath       = "/clients_api/doorbots/{device_id}/subscribe"
	DeviceMotionSubscribePath     = "/clients_api/doorbots/{device_id}/motions_subscribe"
	PersistentLiveViewPath        = "/duos/v1/devices/{device_id}/update"
	RecordingFavoritePath         = "/clients_api/dings/{recording_id}/favorite"
	RecordingDeletePath           = "/clients_api/dings/{recording_id}"
	SessionPath                   = "/clients_api/session"
	DingsActivePath               = "/clients_api/dings/active"
	DoorbotHistoryPath            = "/clients_api/doorbots/{device_id}/history"
	RecordingPath                 = "/clients_api/dings/{recording_id}/recording"
	RecordingSharePath            = "/clients_api/dings/{recording_id}/share/play"
	DeviceSettingsPath            = "/devices/v1/devices/{device_id}/settings"
	DoorbotSirenOnPath            = "/clients_api/doorbots/{device_id}/siren_on"
	DoorbotSirenOffPath           = "/clients_api/doorbots/{device_id}/siren_off"
	LegacyChimePath               = "/clients_api/chimes/{device_id}"
	LegacyDoorbotPath             = "/clients_api/doorbots/{device_id}"
	LegacyChimeSoundPath          = "/clients_api/chimes/{device_id}/play_sound"
	DoorbotLightOnPath            = "/clients_api/doorbots/{device_id}/floodlight_light_on"
	DoorbotLightOffPath           = "/clients_api/doorbots/{device_id}/floodlight_light_off"
	LegacySnapshotTimestampPath   = "/clients_api/snapshots/timestamps"
	LegacySnapshotImagePath       = "/clients_api/snapshots/image/{device_id}"
	OAuthCallbackURL              = "https://ring.com/signin/callback"
	SignalingURL                  = "" /* 140-byte string literal not displayed */
	ExperimentalEventWebSocketURL = "wss://api.ring.com/clients_api/ws"
)
View Source
const (
	FCMCheckinHost       = "android.clients.google.com"
	FCMCheckinPath       = "/checkin"
	FCMRegisterHost      = "android.clients.google.com"
	FCMRegisterPath      = "/c2dm/register3"
	FCMInstallationsHost = "firebaseinstallations.googleapis.com"
	FCMInstallationsPath = "/v1/projects/ring-17770/installations"
	FCMRegistrationsHost = "fcmregistrations.googleapis.com"
	FCMRegistrationsPath = "/v1/projects/ring-17770/registrations"
	FCMProjectID         = "ring-17770"
	FCMApplicationID     = "1:876313859327:android:e10ec6ddb3c81f39"
	// #nosec G101 -- public Firebase client key in the pinned receiver protocol.
	FCMAPIKey                    = "AIzaSyCv-hdFBmmdBBJadNy-TFwB-xN_H5m3Bk8"
	FCMInstallationsAuthHeader   = "X-Goog-Firebase-Installations-Auth"
	FCMInstallationsAPIKeyHeader = "X-Goog-Api-Key"
	FCMContentTypeHeader         = "Content-Type"
	FCMAcceptHeader              = "Accept"
	FCMContentTypeProtobuf       = "application/x-protobuf"
	FCMContentTypeForm           = "application/x-www-form-urlencoded"
	FCMContentTypeJSON           = "application/json"
	FCMInstallationsAuthPrefix   = "FIS "
	FCMInstallationsAuthVersion  = "FIS_v2"
	FCMInstallationsSDKVersion   = "w:0.6.17"
	// #nosec G101 -- public VAPID application key from the pinned receiver protocol.
	FCMDefaultVAPIDKey              = "BDOU99-h67HcA6JeFXHbSNMu7e2yNNu3RzoMj8TM4W88jITfq7ZmPvIM1Iv-4_l2LxQcYwhqby2xGpWwzjfAnG4"
	FCMRegistrationEndpointPrefix   = "https://fcm.googleapis.com/fcm/send/"
	FCMAndroidAppIdentifier         = "org.chromium.linux"
	FCMInstallationsAppIDKey        = "appId"
	FCMInstallationsAuthVersionKey  = "authVersion"
	FCMInstallationsSDKVersionKey   = "sdkVersion"
	FCMRegisterFormAppKey           = "app"
	FCMRegisterFormSubtypeKey       = "X-subtype"
	FCMRegisterFormDeviceKey        = "device"
	FCMRegisterFormSenderKey        = "sender"
	FCMInstallationsNameKey         = "name"
	FCMInstallationsFIDKey          = "fid"
	FCMInstallationsRefreshTokenKey = "refreshToken"
	FCMInstallationsAuthTokenKey    = "authToken"
	FCMInstallationsTokenKey        = "token"
	FCMInstallationsExpiresInKey    = "expiresIn"
	FCMRegistrationWebKey           = "web"
	FCMRegistrationEndpointKey      = "endpoint"
	FCMRegistrationP256DHKey        = "p256dh"
	FCMRegistrationAuthKey          = "auth"
	FCMRegistrationVAPIDKey         = "applicationPubKey"
	FCMRegistrationTokenKey         = "token"
	FCMRegistrationPushSetKey       = "pushSet"
)
View Source
const (
	MCSHost                   = "mtalk.google.com"
	MCSPort                   = "5228"
	MCSAddress                = "mtalk.google.com:5228"
	MCSNetwork                = "tcp"
	MCSTLS                    = true
	MCSDomain                 = "mcs.android.com"
	MCSVersion                = 41
	MCSVersionPacketBytes     = 1
	MCSTagPacketBytes         = 1
	MCSLengthEncoding         = "protobuf-varint"
	MCSHeartbeatPingTag       = 0
	MCSHeartbeatAckTag        = 1
	MCSLoginRequestTag        = 2
	MCSLoginResponseTag       = 3
	MCSCloseTag               = 4
	MCSMessageStanzaTag       = 5
	MCSPresenceStanzaTag      = 6
	MCSIqStanzaTag            = 7
	MCSDataMessageStanzaTag   = 8
	MCSBatchPresenceStanzaTag = 9
	MCSStreamErrorStanzaTag   = 10
	MCSHTTPRequestTag         = 11
	MCSHTTPResponseTag        = 12
	MCSBindAccountRequestTag  = 13
	MCSBindAccountResponseTag = 14
	MCSTalkMetadataTag        = 15
	MCSNumProtoTypesTag       = 16
	MCSUnknownTag             = 255
)
View Source
const (
	SignalingChannel     = "serverEnvelope"
	AccountEventsChannel = "accountEvent"

	MethodActivateSession     = "activate_session"
	MethodCameraOptions       = "camera_options"
	MethodCameraStarted       = "camera_started"
	MethodClose               = "close"
	MethodICE                 = "ice"
	MethodLiveView            = "live_view"
	MethodMicEnable           = "mic_enable"
	MethodNotification        = "notification"
	MethodPing                = "ping"
	MethodPlayback            = "playback"
	MethodPong                = "pong"
	MethodPushEvent           = "push_event"
	MethodPushHeartbeat       = "push_heartbeat"
	MethodPushSubscribe       = "push_subscribe"
	MethodPushSubscriptionAck = "push_subscription_ack"
	MethodPushUnsubscribe     = "push_unsubscribe"
	MethodRPC                 = "rpc"
	MethodSDP                 = "sdp"
	MethodSessionCreated      = "session_created"
	MethodStreamOptions       = "stream_options"
	RPCPanStep                = "PTZ.Pan.Step"
	RPCPanContinuous          = "PTZ.Pan.Continuous"
	RPCTiltStep               = "PTZ.Tilt.Step"
	RPCTiltContinuous         = "PTZ.Tilt.Continuous"
	RPCPanHalted              = "PTZ.Pan.Halted"
	JSONRPCVersion            = "2.0"
	PTZVersion                = 1
	PTZMaxSpeed               = 1
	PanLeft                   = "LEFT"
	PanRight                  = "RIGHT"
	TiltUp                    = "UP"
	TiltDown                  = "DOWN"
	SDPTypeOffer              = "offer"
	SDPTypeAnswer             = "answer"
	SubscriptionStatusOK      = "ok"
	SDPSendRecv               = "sendrecv"
	SDPSendOnly               = "sendonly"
	SDPRecvOnly               = "recvonly"
	SDPInactive               = "inactive"
	FieldDeviceID             = "doorbot_id"
	FieldSessionID            = "session_id"
	FieldEnabled              = "enabled"
	FieldAudioEnabled         = "audio_enabled"
	FieldVideoEnabled         = "video_enabled"
	FieldDirection            = "direction"
	FieldSpeed                = "speed"
	FieldSessionIDRPC         = "sessionId"
	FieldTimestamp            = "timestamp"
	FieldVersion              = "version"
	FieldCommand              = "command"
)
View Source
const JWTCompactSegmentCount = 3

JWTCompactSegmentCount is the number of dot-separated parts in a compact JWS.

Variables

This section is empty.

Functions

func ValidateWebSocketOverride added in v0.5.0

func ValidateWebSocketOverride(rawURL string) error

ValidateWebSocketOverride checks a caller-supplied transport URL.

func ValidateWebSocketURL added in v0.5.0

func ValidateWebSocketURL(channel, rawURL string) error

ValidateWebSocketURL checks a default endpoint against its AsyncAPI channel.

Types

type EndpointSet

type EndpointSet struct {
	OAuthBaseURL     string
	APIBaseURL       string
	SolutionsBaseURL string
	SignalingURL     string
}

EndpointSet contains per-client service origins. Empty values inherit the selected region's evidenced defaults; URLs must be absolute HTTP(S)/WS(S).

func Profile

func Profile(region string) EndpointSet

Profile returns the verified endpoint defaults for a region. Ring's public API and OAuth hosts are established, while only the US Solutions bootstrap origin is evidenced. EU and FE callers must provide SolutionsBaseURL.

Jump to

Keyboard shortcuts

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