Documentation
ΒΆ
Index ΒΆ
- type BotIDHeaderInput
- type BotIDHeaderResult
- type ClientHints
- type CompressionType
- type DataDomeInterstitialInput
- type DataDomeInterstitialResult
- type DataDomeSliderInput
- type DataDomeSliderResult
- type DataDomeTagsInput
- type DataDomeTagsResult
- type DynamicInput
- type KasadaHeaders
- type KasadaPayloadInput
- type KasadaPayloadResult
- type KasadaPowInput
- type KasadaPowResult
- type PixelInput
- type PixelResult
- type Reese84Result
- type ReeseInput
- type SbsdInput
- type SbsdResult
- type SensorInput
- type SensorResult
- type Session
- func (s *Session) GenerateBotIDHeader(ctx context.Context, input *BotIDHeaderInput) (*BotIDHeaderResult, error)
- func (s *Session) GenerateDataDomeInterstitial(ctx context.Context, input *DataDomeInterstitialInput) (*DataDomeInterstitialResult, error)
- func (s *Session) GenerateDataDomeSlider(ctx context.Context, input *DataDomeSliderInput) (*DataDomeSliderResult, error)
- func (s *Session) GenerateDataDomeTags(ctx context.Context, input *DataDomeTagsInput) (*DataDomeTagsResult, error)
- func (s *Session) GenerateKasadaPayload(ctx context.Context, input *KasadaPayloadInput) (*KasadaPayloadResult, error)
- func (s *Session) GenerateKasadaPow(ctx context.Context, input *KasadaPowInput) (*KasadaPowResult, error)
- func (s *Session) GeneratePixelData(ctx context.Context, input *PixelInput) (*PixelResult, error)
- func (s *Session) GenerateReese84Sensor(ctx context.Context, input *ReeseInput) (*Reese84Result, error)
- func (s *Session) GenerateSbsdData(ctx context.Context, input *SbsdInput) (*SbsdResult, error)
- func (s *Session) GenerateSensorData(ctx context.Context, input *SensorInput) (*SensorResult, error)
- func (s *Session) GenerateTelemetry(ctx context.Context, input *TelemetryInput) (*TelemetryResult, error)
- func (s *Session) GenerateUtmvcCookie(ctx context.Context, input *UtmvcInput) (*UtmvcResult, error)
- func (s *Session) GetTelemetryParams(ctx context.Context, input *TelemetryParamsInput) (*TelemetryParamsResult, error)
- func (s *Session) WithClient(client *http.Client) *Session
- func (s *Session) WithCompression(compression CompressionType) *Session
- func (s *Session) WithJwtKey(jwt string) *Session
- func (s *Session) WithOrganization(key, secret string) *Session
- type TelemetryInput
- type TelemetryParamsInput
- type TelemetryParamsResult
- type TelemetryResult
- type UtmvcInput
- type UtmvcResult
Constants ΒΆ
This section is empty.
Variables ΒΆ
This section is empty.
Functions ΒΆ
This section is empty.
Types ΒΆ
type BotIDHeaderInput ΒΆ
type BotIDHeaderInput struct {
Script string `json:"script"`
UserAgent string `json:"userAgent"`
IP string `json:"ip"`
AcceptLanguage string `json:"acceptLanguage"`
}
func (BotIDHeaderInput) MarshalEasyJSON ΒΆ
func (v BotIDHeaderInput) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (BotIDHeaderInput) MarshalJSON ΒΆ
func (v BotIDHeaderInput) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*BotIDHeaderInput) UnmarshalEasyJSON ΒΆ
func (v *BotIDHeaderInput) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*BotIDHeaderInput) UnmarshalJSON ΒΆ
func (v *BotIDHeaderInput) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type BotIDHeaderResult ΒΆ
type BotIDHeaderResult struct {
// Payload is the x-is-human header value.
Payload string
}
BotIDHeaderResult is returned by Session.GenerateBotIDHeader.
type ClientHints ΒΆ
ClientHints are the Accept-CH client hint headers for the device a payload was generated for, keyed by lowercase header name, with values ready to send verbatim (already serialized the way Chrome sends them; do not re-quote).
The API returns every hint Chrome sends once a site opts in via Accept-CH: sec-ch-ua, sec-ch-ua-mobile, sec-ch-ua-platform, sec-ch-ua-arch, sec-ch-ua-bitness, sec-ch-ua-model, sec-ch-ua-platform-version, sec-ch-ua-full-version, sec-ch-ua-full-version-list, sec-ch-ua-wow64, sec-ch-ua-form-factors, sec-ch-device-memory, sec-ch-dpr, sec-ch-viewport-width, sec-ch-viewport-height, device-memory, dpr, viewport-width, ect, rtt, downlink, sec-ch-prefers-color-scheme, sec-ch-prefers-reduced-motion and sec-ch-prefers-reduced-transparency. Send only the ones the target site asked for in its Accept-CH response header; sending hints a site never requested is not what a browser does.
Nil when the API returned none: Safari user agents, and payloads built by a remote browser.
type CompressionType ΒΆ
type CompressionType string
CompressionType represents the compression algorithm to use
const ( CompressionZstd CompressionType = "zstd" CompressionGzip CompressionType = "gzip" )
type DataDomeInterstitialInput ΒΆ
type DataDomeInterstitialInput struct {
// UserAgent must be a Chrome Windows User-Agent.
UserAgent string `json:"userAgent"`
// DeviceLink is the URL that contains the script and starts like this:
// https://geo.captcha-delivery.com/captcha/?initialCid
DeviceLink string `json:"deviceLink"`
// Html is the response body of the GET request to the DeviceLink
Html string `json:"html"`
// Script is the DataDome challenge bundle. It is only needed when the
// challenge page loads the bundle with a <script defer src="..."> tag
// instead of inlining it, which DataDome does per request. Use
// datadome.ParseChallengeScriptURL on the Html to find out, then GET that
// URL with the same client and pass the response body here.
//
// Leave it empty when the page inlines the bundle.
Script string `json:"script"`
AcceptLanguage string `json:"acceptLanguage"`
IP string `json:"ip"`
}
func (DataDomeInterstitialInput) MarshalEasyJSON ΒΆ
func (v DataDomeInterstitialInput) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (DataDomeInterstitialInput) MarshalJSON ΒΆ
func (v DataDomeInterstitialInput) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*DataDomeInterstitialInput) UnmarshalEasyJSON ΒΆ
func (v *DataDomeInterstitialInput) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*DataDomeInterstitialInput) UnmarshalJSON ΒΆ
func (v *DataDomeInterstitialInput) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type DataDomeInterstitialResult ΒΆ
type DataDomeInterstitialResult struct {
// Payload is the form body to POST for a solved datadome cookie.
Payload string
// ClientHints are the Accept-CH headers for the device the payload describes.
ClientHints ClientHints
}
DataDomeInterstitialResult is returned by Session.GenerateDataDomeInterstitial.
type DataDomeSliderInput ΒΆ
type DataDomeSliderInput struct {
// UserAgent must be a Chrome Windows User-Agent.
UserAgent string `json:"userAgent"`
// DeviceLink is the URL that contains the script and starts like this:
// https://geo.captcha-delivery.com/captcha/?initialCid
DeviceLink string `json:"deviceLink"`
// Html is the response body of the GET request to the DeviceLink
Html string `json:"html"`
// Puzzle is the captcha puzzle image bytes, base64 encoded.
// The URL that returns the puzzle looks like this:
// https://dd.prod.captcha-delivery.com/image/2024-xx-xx/hash.jpg
Puzzle string `json:"puzzle"`
// Piece is the captcha puzzle piece image bytes, base64 encoded.
// The URL that returns the puzzle looks like this:
// https://dd.prod.captcha-delivery.com/image/2024-xx-xx/hash.frag.png
Piece string `json:"piece"`
ParentUrl string `json:"parentUrl"`
// Script is the DataDome challenge bundle. It is only needed when the
// challenge page loads the bundle with a <script defer src="..."> tag
// instead of inlining it, which DataDome does per request. Use
// datadome.ParseChallengeScriptURL on the Html to find out, then GET that
// URL with the same client and pass the response body here.
//
// Leave it empty when the page inlines the bundle.
Script string `json:"script"`
AcceptLanguage string `json:"acceptLanguage"`
IP string `json:"ip"`
}
func (DataDomeSliderInput) MarshalEasyJSON ΒΆ
func (v DataDomeSliderInput) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (DataDomeSliderInput) MarshalJSON ΒΆ
func (v DataDomeSliderInput) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*DataDomeSliderInput) UnmarshalEasyJSON ΒΆ
func (v *DataDomeSliderInput) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*DataDomeSliderInput) UnmarshalJSON ΒΆ
func (v *DataDomeSliderInput) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type DataDomeSliderResult ΒΆ
type DataDomeSliderResult struct {
// Payload is the URL that returns a solved datadome cookie.
Payload string
// ClientHints are the Accept-CH headers for the device the payload describes.
ClientHints ClientHints
}
DataDomeSliderResult is returned by Session.GenerateDataDomeSlider.
type DataDomeTagsInput ΒΆ
type DataDomeTagsInput struct {
// UserAgent must be a Chrome Windows User-Agent.
UserAgent string `json:"userAgent"`
Cid string `json:"cid"`
Ddk string `json:"ddk"`
Referer string `json:"referer"`
Type string `json:"type"`
Version string `json:"version"`
AcceptLanguage string `json:"acceptLanguage"`
IP string `json:"ip"`
}
func (DataDomeTagsInput) MarshalEasyJSON ΒΆ
func (v DataDomeTagsInput) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (DataDomeTagsInput) MarshalJSON ΒΆ
func (v DataDomeTagsInput) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*DataDomeTagsInput) UnmarshalEasyJSON ΒΆ
func (v *DataDomeTagsInput) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*DataDomeTagsInput) UnmarshalJSON ΒΆ
func (v *DataDomeTagsInput) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type DataDomeTagsResult ΒΆ
type DataDomeTagsResult struct {
// Payload is the tags body to POST.
Payload string
// ClientHints are the Accept-CH headers for the device the payload describes.
ClientHints ClientHints
}
DataDomeTagsResult is returned by Session.GenerateDataDomeTags.
type DynamicInput ΒΆ
type DynamicInput struct {
// Script is the akamai script's contents.
Script string `json:"script"`
}
func (DynamicInput) MarshalEasyJSON ΒΆ
func (v DynamicInput) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (DynamicInput) MarshalJSON ΒΆ
func (v DynamicInput) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*DynamicInput) UnmarshalEasyJSON ΒΆ
func (v *DynamicInput) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*DynamicInput) UnmarshalJSON ΒΆ
func (v *DynamicInput) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type KasadaHeaders ΒΆ
type KasadaHeaders struct {
XKpsdkCt string `json:"x-kpsdk-ct"`
XKpsdkDt string `json:"x-kpsdk-dt"`
XKpsdkV string `json:"x-kpsdk-v"`
XKpsdkR string `json:"x-kpsdk-r"`
XKpsdkDv string `json:"x-kpsdk-dv"`
XKpsdkH string `json:"x-kpsdk-h"`
XKpsdkFc string `json:"x-kpsdk-fc"`
XKpsdkIm string `json:"x-kpsdk-im"`
}
func (KasadaHeaders) MarshalEasyJSON ΒΆ
func (v KasadaHeaders) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (KasadaHeaders) MarshalJSON ΒΆ
func (v KasadaHeaders) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*KasadaHeaders) UnmarshalEasyJSON ΒΆ
func (v *KasadaHeaders) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*KasadaHeaders) UnmarshalJSON ΒΆ
func (v *KasadaHeaders) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type KasadaPayloadInput ΒΆ
type KasadaPayloadInput struct {
// UserAgent must be a Chrome Windows User-Agent.
UserAgent string `json:"userAgent"`
// IpsLink is the ips.js script link, parsed from the block page (429 status code)
IpsLink string `json:"ipsLink"`
// Script is the ips.js script retrieved using the IpsLink url
Script string `json:"script"`
AcceptLanguage string `json:"acceptLanguage"`
IP string `json:"ip,omitempty"`
// Strict refuses the payload instead of returning one built on a guess when
// the script has a signal the API cannot identify yet. The request then
// fails with "Unidentified signals in script; refusing payload because
// strict was set". Off by default: such a payload usually still works.
Strict bool `json:"strict,omitempty"`
}
func (KasadaPayloadInput) MarshalEasyJSON ΒΆ
func (v KasadaPayloadInput) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (KasadaPayloadInput) MarshalJSON ΒΆ
func (v KasadaPayloadInput) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*KasadaPayloadInput) UnmarshalEasyJSON ΒΆ
func (v *KasadaPayloadInput) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*KasadaPayloadInput) UnmarshalJSON ΒΆ
func (v *KasadaPayloadInput) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type KasadaPayloadResult ΒΆ
type KasadaPayloadResult struct {
// Payload is the body to POST to /tl.
Payload []byte
// Headers are the x-kpsdk-* headers to send with that POST.
Headers KasadaHeaders
// ClientHints are the Accept-CH headers for the device the payload
// describes. Unlike Headers, send only the ones the site asked for.
ClientHints ClientHints
}
KasadaPayloadResult is returned by Session.GenerateKasadaPayload.
type KasadaPowInput ΒΆ
type KasadaPowInput struct {
// St is the x-kpsdk-st value returned by the /tl POST request
St int `json:"st"`
Ct string `json:"ct"`
Fc string `json:"fc"`
Domain string `json:"domain"`
Script string `json:"script"`
// WorkTime can be used to pre-generate POW strings
WorkTime *int `json:"workTime,omitempty"`
}
func (KasadaPowInput) MarshalEasyJSON ΒΆ
func (v KasadaPowInput) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (KasadaPowInput) MarshalJSON ΒΆ
func (v KasadaPowInput) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*KasadaPowInput) UnmarshalEasyJSON ΒΆ
func (v *KasadaPowInput) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*KasadaPowInput) UnmarshalJSON ΒΆ
func (v *KasadaPowInput) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type KasadaPowResult ΒΆ
type KasadaPowResult struct {
// Payload is the x-kpsdk-cd value.
Payload string
}
KasadaPowResult is returned by Session.GenerateKasadaPow.
type PixelInput ΒΆ
type PixelInput struct {
// UserAgent must be a Chrome Windows User-Agent.
UserAgent string `json:"userAgent"`
HTMLVar string `json:"htmlVar"`
ScriptVar string `json:"scriptVar"`
AcceptLanguage string `json:"acceptLanguage"`
IP string `json:"ip"`
}
func (PixelInput) MarshalEasyJSON ΒΆ
func (v PixelInput) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (PixelInput) MarshalJSON ΒΆ
func (v PixelInput) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*PixelInput) UnmarshalEasyJSON ΒΆ
func (v *PixelInput) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*PixelInput) UnmarshalJSON ΒΆ
func (v *PixelInput) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type PixelResult ΒΆ
type PixelResult struct {
// Payload is the pixel data to post.
Payload string
}
PixelResult is returned by Session.GeneratePixelData.
type Reese84Result ΒΆ
type Reese84Result struct {
// Payload is the reese84 sensor to post.
Payload string
// ClientHints are the Accept-CH headers for the device the payload
// describes. Nil for Safari user agents.
ClientHints ClientHints
}
Reese84Result is returned by Session.GenerateReese84Sensor.
type ReeseInput ΒΆ
type ReeseInput struct {
UserAgent string `json:"userAgent"`
AcceptLanguage string `json:"acceptLanguage"`
IP string `json:"ip"`
ScriptUrl string `json:"scriptUrl"`
PageUrl string `json:"pageUrl"`
Pow string `json:"pow"`
Script string `json:"script"`
}
func (ReeseInput) MarshalEasyJSON ΒΆ
func (v ReeseInput) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (ReeseInput) MarshalJSON ΒΆ
func (v ReeseInput) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*ReeseInput) UnmarshalEasyJSON ΒΆ
func (v *ReeseInput) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*ReeseInput) UnmarshalJSON ΒΆ
func (v *ReeseInput) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type SbsdInput ΒΆ
type SbsdInput struct {
// UserAgent must be a Chrome Windows User-Agent.
UserAgent string `json:"userAgent"`
Uuid string `json:"uuid"`
PageUrl string `json:"pageUrl"`
OCookie string `json:"o"`
// Script is mutually exclusive with [SbsdInput.Context], the first sbsd request should include the script field.
// Subsequent requests should only include the Context.
// A hard block (an SBSD POST with a t parameter) always starts a new chain: send Script and an empty
// Context, never the Context from an earlier request.
Script string `json:"script"`
// ScriptUrl is the absolute src of the SBSD script tag, query included.
// Optional: when set, the fingerprint's resource-timing signal carries the
// script's own entry the way a browser's does.
ScriptUrl string `json:"scriptUrl,omitempty"`
AcceptLanguage string `json:"acceptLanguage"`
IP string `json:"ip"`
Context string `json:"context"`
}
func (SbsdInput) MarshalEasyJSON ΒΆ
MarshalEasyJSON supports easyjson.Marshaler interface
func (SbsdInput) MarshalJSON ΒΆ
MarshalJSON supports json.Marshaler interface
func (*SbsdInput) UnmarshalEasyJSON ΒΆ
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*SbsdInput) UnmarshalJSON ΒΆ
UnmarshalJSON supports json.Unmarshaler interface
type SbsdResult ΒΆ
type SbsdResult struct {
// Payload is the sbsd body to post.
Payload string
// Context must be sent back on the next sbsd request of the session.
Context string
// ClientHints are the Accept-CH headers for the device the payload describes.
ClientHints ClientHints
}
SbsdResult is returned by Session.GenerateSbsdData.
type SensorInput ΒΆ
type SensorInput struct {
// Abck is the _abck cookie retrieved from your cookiejar.
// Make sure you always retrieve it fresh from the cookiejar as it gets updated while making requests.
Abck string `json:"abck"`
// Bmsz is the bm_sz cookie retrieved from your cookiejar, make sure you always retrieve it fresh from the cookiejar.
Bmsz string `json:"bmsz"`
// Version is the akamai version, this will usually be "2"
Version string `json:"version"`
// PageUrl is the page url that loaded the akamai script, it is the same URL as the referer header on the sensor posts
PageUrl string `json:"pageUrl"`
// UserAgent must be a Chrome Windows User-Agent.
UserAgent string `json:"userAgent"`
// Script is mutually exclusive with [SensorInput.Context], the first sensor request should include the script field.
// Subsequent request should only include the Context.
Script string `json:"script"`
// ScriptUrl is the full URL where you are posting sensor data to
ScriptUrl string `json:"scriptUrl"`
AcceptLanguage string `json:"acceptLanguage"`
IP string `json:"ip"`
Context string `json:"context"`
}
func (SensorInput) MarshalEasyJSON ΒΆ
func (v SensorInput) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (SensorInput) MarshalJSON ΒΆ
func (v SensorInput) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*SensorInput) UnmarshalEasyJSON ΒΆ
func (v *SensorInput) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*SensorInput) UnmarshalJSON ΒΆ
func (v *SensorInput) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type SensorResult ΒΆ
type SensorResult struct {
// Payload is the sensor data to post.
Payload string
// Context must be sent back on the next sensor request of the session.
Context string
// ClientHints are the Accept-CH headers for the device the payload describes.
ClientHints ClientHints
}
SensorResult is returned by Session.GenerateSensorData.
type Session ΒΆ
type Session struct {
ApiKey string
JwtKey []byte
AppKey string
AppSecret []byte
Client *http.Client
Compression CompressionType
}
func NewSession ΒΆ
NewSession creates a new Session that can be used to make requests to the Hyper Solutions API.
func (*Session) GenerateBotIDHeader ΒΆ
func (s *Session) GenerateBotIDHeader(ctx context.Context, input *BotIDHeaderInput) (*BotIDHeaderResult, error)
GenerateBotIDHeader returns the x-is-human header value
func (*Session) GenerateDataDomeInterstitial ΒΆ
func (s *Session) GenerateDataDomeInterstitial(ctx context.Context, input *DataDomeInterstitialInput) (*DataDomeInterstitialResult, error)
GenerateDataDomeInterstitial returns the form data string that is used in the POST request to receive a solved datadome cookie, and the Accept-CH client hints for the device.
func (*Session) GenerateDataDomeSlider ΒΆ
func (s *Session) GenerateDataDomeSlider(ctx context.Context, input *DataDomeSliderInput) (*DataDomeSliderResult, error)
GenerateDataDomeSlider returns the URL that will return a solved datadome cookie when blocked by captcha, and the Accept-CH client hints for the device.
func (*Session) GenerateDataDomeTags ΒΆ
func (s *Session) GenerateDataDomeTags(ctx context.Context, input *DataDomeTagsInput) (*DataDomeTagsResult, error)
GenerateDataDomeTags returns the tags data string that is used in the POST request to receive a solved datadome cookie, and the Accept-CH client hints for the device.
func (*Session) GenerateKasadaPayload ΒΆ
func (s *Session) GenerateKasadaPayload(ctx context.Context, input *KasadaPayloadInput) (*KasadaPayloadResult, error)
GenerateKasadaPayload returns the payload to POST to /tl in bytes, the x-kpsdk-* headers to send with it, and the Accept-CH client hints for the device.
func (*Session) GenerateKasadaPow ΒΆ
func (s *Session) GenerateKasadaPow(ctx context.Context, input *KasadaPowInput) (*KasadaPowResult, error)
GenerateKasadaPow returns the x-kpsdk-cd value
func (*Session) GeneratePixelData ΒΆ
func (s *Session) GeneratePixelData(ctx context.Context, input *PixelInput) (*PixelResult, error)
GeneratePixelData returns the pixel data using the Hyper Solutions API.
func (*Session) GenerateReese84Sensor ΒΆ
func (s *Session) GenerateReese84Sensor(ctx context.Context, input *ReeseInput) (*Reese84Result, error)
GenerateReese84Sensor returns the sensor data required to generate valid reese84 cookies using the Hyper Solutions API, and the Accept-CH client hints for the device.
func (*Session) GenerateSbsdData ΒΆ
GenerateSbsdData returns the sbsd payload, the context for the next sbsd request, and the Accept-CH client hints for the device, using the Hyper Solutions API.
func (*Session) GenerateSensorData ΒΆ
func (s *Session) GenerateSensorData(ctx context.Context, input *SensorInput) (*SensorResult, error)
GenerateSensorData returns the sensor data required to generate valid akamai cookies using the Hyper Solutions API, the context for the next sensor request, and the Accept-CH client hints for the device.
func (*Session) GenerateTelemetry ΒΆ
func (s *Session) GenerateTelemetry(ctx context.Context, input *TelemetryInput) (*TelemetryResult, error)
GenerateTelemetry returns the value of the Akamai-BM-Telemetry header that the site's protected API calls carry, the context for the next telemetry request, and the Accept-CH client hints for the device, using the Hyper Solutions API. Each protected call takes a fresh header built from the previous call's context.
func (*Session) GenerateUtmvcCookie ΒΆ
func (s *Session) GenerateUtmvcCookie(ctx context.Context, input *UtmvcInput) (*UtmvcResult, error)
GenerateUtmvcCookie returns the utmvc cookie and the swhanedl value using the Hyper Solutions API.
func (*Session) GetTelemetryParams ΒΆ
func (s *Session) GetTelemetryParams(ctx context.Context, input *TelemetryParamsInput) (*TelemetryParamsResult, error)
GetTelemetryParams returns the path of the site's get_params request, whose response carries the "j" for TelemetryInput.J, and a context that can replace the script on the first telemetry request, using the Hyper Solutions API.
func (*Session) WithClient ΒΆ
WithClient sets a new client that will be used to make requests to the Hyper Solutions API.
func (*Session) WithCompression ΒΆ
func (s *Session) WithCompression(compression CompressionType) *Session
WithCompression sets the compression type for requests.
func (*Session) WithJwtKey ΒΆ
WithJwtKey adds the JWT Key to the session. If not empty, a signature will be added to each request.
func (*Session) WithOrganization ΒΆ
WithOrganization adds the organization to the session.
type TelemetryInput ΒΆ
type TelemetryInput struct {
SensorInput
// J is the "j" from the response of the site's get_params request (see [Session.GetTelemetryParams]), sent
// as it was returned. Leave it empty when the site makes no get_params request.
J string `json:"j"`
}
TelemetryInput is the input of Session.GenerateTelemetry: a sensor request for a site that sends an Akamai-BM-Telemetry header on its protected API calls instead of posting sensor data.
Only v3 dynamic scripts send the header, so SensorInput.Version may be left empty. Script and Context chain across headers the same way they do across sensor posts.
func (TelemetryInput) MarshalEasyJSON ΒΆ
func (v TelemetryInput) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (TelemetryInput) MarshalJSON ΒΆ
func (v TelemetryInput) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*TelemetryInput) UnmarshalEasyJSON ΒΆ
func (v *TelemetryInput) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*TelemetryInput) UnmarshalJSON ΒΆ
func (v *TelemetryInput) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type TelemetryParamsInput ΒΆ
type TelemetryParamsInput struct {
// PageUrl is the page url that loaded the akamai script.
PageUrl string `json:"pageUrl"`
// Script is the akamai script, mutually exclusive with [TelemetryParamsInput.Context].
Script string `json:"script"`
// Context is a context returned by an earlier telemetry or telemetry params request, mutually exclusive with
// [TelemetryParamsInput.Script].
Context string `json:"context"`
}
TelemetryParamsInput is the input of Session.GetTelemetryParams.
func (TelemetryParamsInput) MarshalEasyJSON ΒΆ
func (v TelemetryParamsInput) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (TelemetryParamsInput) MarshalJSON ΒΆ
func (v TelemetryParamsInput) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*TelemetryParamsInput) UnmarshalEasyJSON ΒΆ
func (v *TelemetryParamsInput) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*TelemetryParamsInput) UnmarshalJSON ΒΆ
func (v *TelemetryParamsInput) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type TelemetryParamsResult ΒΆ
type TelemetryParamsResult struct {
// Path is the path of the site's get_params request, exactly as the browser
// requests it. Send a GET to it on the page's origin; the "j" in its JSON
// response goes into [TelemetryInput.J].
Path string
// Context can replace the script on the first [Session.GenerateTelemetry] request.
Context string
}
TelemetryParamsResult is returned by Session.GetTelemetryParams.
type TelemetryResult ΒΆ
type TelemetryResult struct {
// Header is the ready-to-send value of the Akamai-BM-Telemetry header.
Header string
// Context must be sent back on the next telemetry request of the session.
Context string
// ClientHints are the Accept-CH headers for the device the header describes.
ClientHints ClientHints
}
TelemetryResult is returned by Session.GenerateTelemetry.
type UtmvcInput ΒΆ
type UtmvcInput struct {
UserAgent string `json:"userAgent"`
// SessionIds The value of each cookie that has a name that starts with incap_ses_
SessionIds []string `json:"sessionIds"`
// Script is the UTMVC script contents
Script string `json:"script"`
}
func (UtmvcInput) MarshalEasyJSON ΒΆ
func (v UtmvcInput) MarshalEasyJSON(w *jwriter.Writer)
MarshalEasyJSON supports easyjson.Marshaler interface
func (UtmvcInput) MarshalJSON ΒΆ
func (v UtmvcInput) MarshalJSON() ([]byte, error)
MarshalJSON supports json.Marshaler interface
func (*UtmvcInput) UnmarshalEasyJSON ΒΆ
func (v *UtmvcInput) UnmarshalEasyJSON(l *jlexer.Lexer)
UnmarshalEasyJSON supports easyjson.Unmarshaler interface
func (*UtmvcInput) UnmarshalJSON ΒΆ
func (v *UtmvcInput) UnmarshalJSON(data []byte) error
UnmarshalJSON supports json.Unmarshaler interface
type UtmvcResult ΒΆ
type UtmvcResult struct {
// Payload is the ___utmvc cookie value.
Payload string
// Swhanedl is the swhanedl value for the utmvc request.
Swhanedl string
}
UtmvcResult is returned by Session.GenerateUtmvcCookie.