Skip to content
This repository has been archived by the owner on Dec 22, 2022. It is now read-only.

Commit

Permalink
Typos Fix (prebid#1236)
Browse files Browse the repository at this point in the history
* Fix Typo

* Fixed More Typos
  • Loading branch information
SyntaxNode authored Apr 6, 2020
1 parent b1494f2 commit 7f3778e
Show file tree
Hide file tree
Showing 28 changed files with 67 additions and 64 deletions.
2 changes: 1 addition & 1 deletion adapters/adapterstest/test_json.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ func diffJson(t *testing.T, description string, actual []byte, expected []byte)
if diff.Modified() {
var left interface{}
if err := json.Unmarshal(actual, &left); err != nil {
t.Fatalf("%s json did not match, but unmarhsalling failed. %v", description, err)
t.Fatalf("%s json did not match, but unmarshalling failed. %v", description, err)
}
printer := formatter.NewAsciiFormatter(left, formatter.AsciiFormatterConfig{
ShowArrayIndex: true,
Expand Down
6 changes: 3 additions & 3 deletions analytics/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func TestSampleModule(t *testing.T) {
Response: &openrtb.BidResponse{},
})
if count != 1 {
t.Errorf("PBSAnalyticsModule failed at LogAuctionObejct")
t.Errorf("PBSAnalyticsModule failed at LogAuctionObject")
}

am.LogSetUIDObject(&analytics.SetUIDObject{
Expand All @@ -33,12 +33,12 @@ func TestSampleModule(t *testing.T) {
Success: true,
})
if count != 2 {
t.Errorf("PBSAnalyticsModule failed at LogSetUIDObejct")
t.Errorf("PBSAnalyticsModule failed at LogSetUIDObject")
}

am.LogCookieSyncObject(&analytics.CookieSyncObject{})
if count != 3 {
t.Errorf("PBSAnalyticsModule failed at LogCookieSyncObejct")
t.Errorf("PBSAnalyticsModule failed at LogCookieSyncObject")
}

am.LogAmpObject(&analytics.AmpObject{})
Expand Down
2 changes: 1 addition & 1 deletion config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ const (
type Adapter struct {
Endpoint string `mapstructure:"endpoint"` // Required
// UserSyncURL is the URL returned by /cookie_sync for this Bidder. It is _usually_ optional.
// If not defined, sensible defaults will be derved based on the config.external_url.
// If not defined, sensible defaults will be derived based on the config.external_url.
// Note that some Bidders don't have sensible defaults, because their APIs require an ID that will vary
// from one PBS host to another.
//
Expand Down
4 changes: 2 additions & 2 deletions config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -417,9 +417,9 @@ func TestCookieSizeError(t *testing.T) {
}
for i := range testCases {
if testCases[i].expectError {
assert.Error(t, isValidCookieSize(testCases[i].cookieHost.MaxCookieSizeBytes), fmt.Sprintf("Configuration.HostCooki.MaxCookieSizeBytes less than MIN_COOKIE_SIZE_BYTES = %d and not equal to zero should return an error", MIN_COOKIE_SIZE_BYTES))
assert.Error(t, isValidCookieSize(testCases[i].cookieHost.MaxCookieSizeBytes), fmt.Sprintf("Configuration.HostCookie.MaxCookieSizeBytes less than MIN_COOKIE_SIZE_BYTES = %d and not equal to zero should return an error", MIN_COOKIE_SIZE_BYTES))
} else {
assert.NoError(t, isValidCookieSize(testCases[i].cookieHost.MaxCookieSizeBytes), fmt.Sprintf("Configuration.HostCooki.MaxCookieSizeBytes greater than MIN_COOKIE_SIZE_BYTES = %d or equal to zero should not return an error", MIN_COOKIE_SIZE_BYTES))
assert.NoError(t, isValidCookieSize(testCases[i].cookieHost.MaxCookieSizeBytes), fmt.Sprintf("Configuration.HostCookie.MaxCookieSizeBytes greater than MIN_COOKIE_SIZE_BYTES = %d or equal to zero should not return an error", MIN_COOKIE_SIZE_BYTES))
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion config/stored_requests.go
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,7 @@ func (cfg *PostgresUpdatePolling) validate(errs configErrors) configErrors {
return errs
}

// MakeQuery builds a query which can fetch numReqs Stored Requetss and numImps Stored Imps.
// MakeQuery builds a query which can fetch numReqs Stored Requests and numImps Stored Imps.
// See the docs on PostgresConfig.QueryTemplate for a description of how it works.
func (cfg *PostgresFetcherQueriesSlim) MakeQuery(numReqs int, numImps int) (query string) {
return resolve(cfg.QueryTemplate, numReqs, numImps)
Expand Down
2 changes: 1 addition & 1 deletion docs/bidders/appnexus.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The AppNexus endpoint expects `imp.displaymanagerver` to be populated for mobile
requests, however not all SDKs will populate this field. If the `imp.displaymanagerver` field
is not supplied for an `imp`, but `request.app.ext.prebid.source`
and `request.app.ext.prebid.version` are supplied, the adapter will fill in a value for
`diplaymanagerver`. It will concatonate the two `app` fields as `<source>-<version>` fo fill in
`diplaymanagerver`. It will concatenate the two `app` fields as `<source>-<version>` fo fill in
the empty `displaymanagerver` before sending the request to AppNexus.

## Test Request
Expand Down
2 changes: 1 addition & 1 deletion docs/bidders/audienceNetwork.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
## Mobile Bids

Audience Network will not bid on requests made from device simulators.
When testingfor Mobile bids, you must make bid requests using a real device.
When testing for Mobile bids, you must make bid requests using a real device.

**Note:** Audience Network is disabled by default. Please enable it in the app config if you wish to use it. Make sure you provide the partnerID for the auctions to run correctly.
2 changes: 1 addition & 1 deletion docs/bidders/sovrn.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Sovrn supports 2 parameters to be present in the `ext` object of impressions sent to it:
- tagid: a string containing the sovrn-specific id(s) for the publisher's ad tag(s) they would like to bid with. This is a required field
- bidfloor: The minimium acceptable bid, in CPM, using US Dollars. This is an optional field.
- bidfloor: The minimum acceptable bid, in CPM, using US Dollars. This is an optional field.
2 changes: 1 addition & 1 deletion docs/developers/automated-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ To reproduce these tests locally, use:

## Writing Tests

Tests for `some-file.go` should be placed in the file `some-file_test.go` in the same paackage.
Tests for `some-file.go` should be placed in the file `some-file_test.go` in the same package.
For more info on how to write tests in Go, see [the Go docs](https://golang.org/pkg/testing/).

## Adapter Tests
Expand Down
2 changes: 1 addition & 1 deletion docs/developers/cookie-syncs.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Cookie Sync Technical Details

This document describes the mechancis of a Prebid Server cookie sync.
This document describes the mechanics of a Prebid Server cookie sync.

## Motivation

Expand Down
6 changes: 3 additions & 3 deletions docs/developers/default-request.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Server Based Global Default Request

This allows a defaut stored request to be defined that allows the server to set up some defaults for all incoming requests. A request specified stored request will override these defaults, and of course any options specified directly in the stored request override both. The default stored request is only read on server startup, it is meant as an installation static default rather than a dynamic tuning option.
This allows a default stored request to be defined that allows the server to set up some defaults for all incoming requests. A request specified stored request will override these defaults, and of course any options specified directly in the stored request override both. The default stored request is only read on server startup, it is meant as an installation static default rather than a dynamic tuning option.

A common use case is to "hard code" aliases into the server. This saves having to specify them on all incoming requests, and/or on all stored requests. To help support automation and alias discovery we can flag that any aliases found in the file be added to the bidder info endpoints.

Expand Down Expand Up @@ -35,8 +35,8 @@ The `filename` option is the path/filename of a JSON file containing the default
```
This will be JSON merged into the incoming requests at the top level. These will be used as fallbacks which can be overridden by both Stored Requests _and_ the incoming HTTP request payload.

The `info` option determines if the alised bidders will be exposed on the `/info` endpoints. If true the alias name will be added to the list returned by
`/info/bidders` and the info JSON for the core bidder will be coppied into `/info/bidder/{biddername}` with the addition of the field
The `info` option determines if the aliased bidders will be exposed on the `/info` endpoints. If true the alias name will be added to the list returned by
`/info/bidders` and the info JSON for the core bidder will be copied into `/info/bidder/{biddername}` with the addition of the field
`"alias_of": "{coreBidder}"` to indicate that it is an aliases, and of which core bidder. Turning the info support on may be useful for hosts
that want to support automation around the `/info` endpoints that will include the predefined aliases. This config option may be deprecated in a future
version to promote a consistency in the endpoint functionality, depending on the perceived need for the option.
Expand Down
2 changes: 1 addition & 1 deletion docs/endpoints/openrtb2/amp.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ This endpoint supports the following query parameters:
6. `curl` - the canonical URL of the page
7. `timeout` - the publisher-specified timeout for the RTC callout
- A configuration option `amp_timeout_adjustment_ms` may be set to account for estimated latency so that Prebid Server can handle timeouts from adapters and respond to the AMP RTC request before it times out.
8. `debug` - When set to `1`, the respones will contain extra info for debugging.
8. `debug` - When set to `1`, the response will contain extra info for debugging.

For information on how these get from AMP into this endpoint, see [this pull request adding the query params to the Prebid callout](https://github.com/ampproject/amphtml/pull/14155) and [this issue adding support for network-level RTC macros](https://github.com/ampproject/amphtml/issues/12374).

Expand Down
8 changes: 4 additions & 4 deletions docs/endpoints/openrtb2/auction.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ for each Bidder by using the `/cookie_sync` endpoint, and calling the URLs that

#### Native Request

For each native request, the `assets` objects's `id` field must not be defined. Prebid Server will set this automatically, using the index of the asset in the array as the ID.
For each native request, the `assets` object's `id` field must not be defined. Prebid Server will set this automatically, using the index of the asset in the array as the ID.


#### Bidder Aliases
Expand Down Expand Up @@ -265,7 +265,7 @@ This can be used to request bids from the same Bidder with different params. For
```

For all intents and purposes, the alias will be treated as another Bidder. This new Bidder will behave exactly
like the original, except that the Response will contain seprate SeatBids, and any Targeting keys
like the original, except that the Response will contain separate SeatBids, and any Targeting keys
will be formed using the alias' name.

If an alias overlaps with a core Bidder's name, then the alias will take precedence.
Expand All @@ -280,7 +280,7 @@ For example, if the Request defines an alias like this:
```

then any `imp.ext.appnexus` params will actually go to the **rubicon** adapter.
It will become impossible to fetch bids from Appnexus within that Request.
It will become impossible to fetch bids from AppNexus within that Request.

#### Bidder Response Times

Expand Down Expand Up @@ -495,7 +495,7 @@ client can declare a given adunit as eligible for rewards by declaring `imp.ext.
While testing SDK and video integrations, it's important, but often difficult, to get consistent responses back from bidders that cover a range of scenarios like different CPM values, deals, etc. Prebid Server supports a debugging workflow in two ways:

- a stored-auction-response that covers multiple bidder responses
- multiple stored-bid-reponses at the bidder adapter level
- multiple stored-bid-responses at the bidder adapter level

**Single Stored Auction Response ID**

Expand Down
10 changes: 5 additions & 5 deletions endpoints/openrtb2/amp_auction_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ func TestGDPRConsent(t *testing.T) {
responseRecorder := httptest.NewRecorder()
endpoint(responseRecorder, request, nil)

// Parse Resonse
// Parse Response
var response AmpResponse
if err := json.Unmarshal(responseRecorder.Body.Bytes(), &response); err != nil {
t.Fatalf("Error unmarshalling response: %s", err.Error())
Expand Down Expand Up @@ -372,7 +372,7 @@ func TestCCPAConsent(t *testing.T) {
responseRecorder := httptest.NewRecorder()
endpoint(responseRecorder, request, nil)

// Parse Resonse
// Parse Response
var response AmpResponse
if err := json.Unmarshal(responseRecorder.Body.Bytes(), &response); err != nil {
t.Fatalf("Error unmarshalling response: %s", err.Error())
Expand Down Expand Up @@ -431,7 +431,7 @@ func TestNoConsent(t *testing.T) {
responseRecorder := httptest.NewRecorder()
endpoint(responseRecorder, request, nil)

// Parse Resonse
// Parse Response
var response AmpResponse
if err := json.Unmarshal(responseRecorder.Body.Bytes(), &response); err != nil {
t.Fatalf("Error unmarshalling response: %s", err.Error())
Expand Down Expand Up @@ -478,7 +478,7 @@ func TestInvalidConsent(t *testing.T) {
responseRecorder := httptest.NewRecorder()
endpoint(responseRecorder, request, nil)

// Parse Resonse
// Parse Response
var response AmpResponse
if err := json.Unmarshal(responseRecorder.Body.Bytes(), &response); err != nil {
t.Fatalf("Error unmarshalling response: %s", err.Error())
Expand Down Expand Up @@ -561,7 +561,7 @@ func TestNewAndLegacyConsentBothProvided(t *testing.T) {
responseRecorder := httptest.NewRecorder()
endpoint(responseRecorder, request, nil)

// Parse Resonse
// Parse Response
var response AmpResponse
if err := json.Unmarshal(responseRecorder.Body.Bytes(), &response); err != nil {
t.Fatalf("Error unmarshalling response: %s", err.Error())
Expand Down
10 changes: 5 additions & 5 deletions endpoints/openrtb2/auction_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ func TestBadNativeRequests(t *testing.T) {
tests.assert(t)
}

// TestAliasedRequests makes sure we handle (defuault) aliased bidders properly
// TestAliasedRequests makes sure we handle (default) aliased bidders properly
func TestAliasedRequests(t *testing.T) {
tests := &getResponseFromDirectory{
dir: "sample-requests/aliased",
Expand Down Expand Up @@ -289,7 +289,7 @@ func (gr *getResponseFromDirectory) assert(t *testing.T) {
filesToAssert = append(filesToAssert, gr.dir+"/"+fileInfo.Name())
}
} else {
// Just test the single `gr.file`, and not the entiriety of files that may be found in `gr.dir`
// Just test the single `gr.file`, and not the entirety of files that may be found in `gr.dir`
filesToAssert = append(filesToAssert, gr.dir+"/"+gr.file)
}

Expand Down Expand Up @@ -805,7 +805,7 @@ func TestDisabledBidder(t *testing.T) {
},
pbsmetrics.NewMetrics(metrics.NewRegistry(), openrtb_ext.BidderList(), config.DisabledMetrics{}),
analyticsConf.NewPBSAnalytics(&config.Analytics{}),
map[string]string{"unknownbidder": "The biddder 'unknownbidder' has been disabled."},
map[string]string{"unknownbidder": "The bidder 'unknownbidder' has been disabled."},
false,
[]byte{},
openrtb_ext.BidderMap,
Expand Down Expand Up @@ -839,15 +839,15 @@ func TestValidateImpExtDisabledBidder(t *testing.T) {
&config.Configuration{MaxRequestSize: int64(8096)},
pbsmetrics.NewMetrics(metrics.NewRegistry(), openrtb_ext.BidderList(), config.DisabledMetrics{}),
analyticsConf.NewPBSAnalytics(&config.Analytics{}),
map[string]string{"unknownbidder": "The biddder 'unknownbidder' has been disabled."},
map[string]string{"unknownbidder": "The bidder 'unknownbidder' has been disabled."},
false,
[]byte{},
openrtb_ext.BidderMap,
nil,
}
errs := deps.validateImpExt(imp, nil, 0)
assert.JSONEq(t, `{"appnexus":{"placement_id":555}}`, string(imp.Ext))
assert.Equal(t, []error{&errortypes.BidderTemporarilyDisabled{Message: "The biddder 'unknownbidder' has been disabled."}}, errs)
assert.Equal(t, []error{&errortypes.BidderTemporarilyDisabled{Message: "The bidder 'unknownbidder' has been disabled."}}, errs)
}

func TestEffectivePubID(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions endpoints/openrtb2/video_auction_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func TestVideoEndpointImpressionsNumber(t *testing.T) {
respBytes := recorder.Body.Bytes()
resp := &openrtb_ext.BidResponseVideo{}
if err := json.Unmarshal(respBytes, resp); err != nil {
t.Fatalf("Unable to umarshal response.")
t.Fatalf("Unable to unmarshal response.")
}

assert.Len(t, ex.lastRequest.Imp, 11, "Incorrect number of impressions in request")
Expand Down Expand Up @@ -197,7 +197,7 @@ func TestVideoEndpointDebugQueryTrue(t *testing.T) {
respBytes := recorder.Body.Bytes()
resp := &openrtb_ext.BidResponseVideo{}
if err := json.Unmarshal(respBytes, resp); err != nil {
t.Fatalf("Unable to umarshal response.")
t.Fatalf("Unable to unmarshal response.")
}

assert.Len(t, ex.lastRequest.Imp, 11, "Incorrect number of impressions in request")
Expand Down Expand Up @@ -239,7 +239,7 @@ func TestVideoEndpointDebugQueryFalse(t *testing.T) {
respBytes := recorder.Body.Bytes()
resp := &openrtb_ext.BidResponseVideo{}
if err := json.Unmarshal(respBytes, resp); err != nil {
t.Fatalf("Unable to umarshal response.")
t.Fatalf("Unable to unmarshal response.")
}

assert.Len(t, ex.lastRequest.Imp, 11, "Incorrect number of impressions in request")
Expand Down
2 changes: 1 addition & 1 deletion exchange/bidder.go
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ func addNativeTypes(bid *openrtb.Bid, request *openrtb.BidRequest) (*nativeRespo
var errs []error
var nativeMarkup *nativeResponse.Response
if err := json.Unmarshal(json.RawMessage(bid.AdM), &nativeMarkup); err != nil || len(nativeMarkup.Assets) == 0 {
// Some bidders are returning non-IAB complaiant native markup. In this case Prebid server will not be able to add types. E.g Facebook
// Some bidders are returning non-IAB compliant native markup. In this case Prebid server will not be able to add types. E.g Facebook
return nil, errs
}

Expand Down
2 changes: 1 addition & 1 deletion exchange/exchange_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1762,7 +1762,7 @@ func diffJson(t *testing.T, description string, actual []byte, expected []byte)
if diff.Modified() {
var left interface{}
if err := json.Unmarshal(actual, &left); err != nil {
t.Fatalf("%s json did not match, but unmarhsalling failed. %v", description, err)
t.Fatalf("%s json did not match, but unmarshalling failed. %v", description, err)
}
printer := formatter.NewAsciiFormatter(left, formatter.AsciiFormatterConfig{
ShowArrayIndex: true,
Expand Down
6 changes: 3 additions & 3 deletions gdpr/gdpr.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ import (
type Permissions interface {
// Determines whether or not the host company is allowed to read/write cookies.
//
// If the consent string was nonsenical, the returned error will be an ErrorMalformedConsent.
// If the consent string was nonsensical, the returned error will be an ErrorMalformedConsent.
HostCookiesAllowed(ctx context.Context, consent string) (bool, error)

// Determines whether or not the given bidder is allowed to user personal info for ad targeting.
//
// If the consent string was nonsenical, the returned error will be an ErrorMalformedConsent.
// If the consent string was nonsensical, the returned error will be an ErrorMalformedConsent.
BidderSyncAllowed(ctx context.Context, bidder openrtb_ext.BidderName, consent string) (bool, error)

// Determines whether or not to send PI information to a bidder, or mask it out.
//
// If the consent string was nonsenical, the returned error will be an ErrorMalformedConsent.
// If the consent string was nonsensical, the returned error will be an ErrorMalformedConsent.
PersonalInfoAllowed(ctx context.Context, bidder openrtb_ext.BidderName, PublisherID string, consent string) (bool, error)
}

Expand Down
4 changes: 3 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,11 @@ func main() {
}
}

const configFileName = "pbs"

func loadConfig() (*config.Configuration, error) {
v := viper.New()
config.SetupViper(v, "pbs") // filke = filename
config.SetupViper(v, configFileName)
return config.New(v)
}

Expand Down
2 changes: 1 addition & 1 deletion openrtb_ext/bid.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const (
HbpbConstantKey TargetingKey = "hb_pb"

// HbEnvKey exists to support the Prebid Universal Creative. If it exists, the only legal value is mobile-app.
// It will exist only if the incoming bidRequest defiend request.app instead of request.site.
// It will exist only if the incoming bidRequest defined request.app instead of request.site.
HbEnvKey TargetingKey = "hb_env"

// HbCacheHost and HbCachePath exist to supply cache host and path as targeting parameters
Expand Down
4 changes: 2 additions & 2 deletions openrtb_ext/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ func (pg *PriceGranularity) UnmarshalJSON(b []byte) error {
func PriceGranularityFromString(gran string) PriceGranularity {
switch gran {
case "low":
return priceGranulrityLow
return priceGranularityLow
case "med", "medium":
// Seems that PBS was written with medium = "med", so hacking that in
return priceGranularityMed
Expand All @@ -175,7 +175,7 @@ func PriceGranularityFromString(gran string) PriceGranularity {
return PriceGranularity{}
}

var priceGranulrityLow = PriceGranularity{
var priceGranularityLow = PriceGranularity{
Precision: 2,
Ranges: []GranularityRange{{
Min: 0,
Expand Down
Loading

0 comments on commit 7f3778e

Please sign in to comment.