Skip to content

Commit

Permalink
remove access token length check (#412)
Browse files Browse the repository at this point in the history
  • Loading branch information
PFacheris authored Mar 22, 2023
1 parent 052ec8b commit 1c65a94
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 34 deletions.
5 changes: 0 additions & 5 deletions launcher/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,11 +287,6 @@ func validateConfiguration(c Config) error {
}
}

// TODO(@tobert) will probably break on some providers but seems fine for my use cases right now
if accessTokenLen > 0 && (accessTokenLen != 32 && accessTokenLen != 84 && accessTokenLen != 104 && accessToken(c) != "developer") {
return fmt.Errorf("invalid configuration: access token length incorrect. Ensure token is set correctly")
}

return nil
}

Expand Down
29 changes: 0 additions & 29 deletions launcher/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import (
)

const (
expectedAccessTokenLengthError = "invalid configuration: access token length incorrect. Ensure token is set correctly"
expectedAccessTokenMissingError = "invalid configuration: access token missing, must be set when reporting to ingest.lightstep.com"
expectedTracingDisabledMessage = "tracing is disabled by configuration: no endpoint set"
expectedMetricsDisabledMessage = "metrics are disabled by configuration: no endpoint set"
Expand Down Expand Up @@ -207,34 +206,6 @@ func (suite *testSuite) TestInvalidMetricDefaultAccessToken() {
)
}

func (suite *testSuite) testInvalidAccessToken(opts ...Option) {
lsOtel := ConfigureOpentelemetry(
append(opts,
WithLogger(&suite.testLogger),
WithServiceName("test-service"),
)...,
)
defer lsOtel.Shutdown()

suite.requireLogContains(expectedAccessTokenLengthError)
}

func (suite *testSuite) TestInvalidTraceAccessTokenLength() {
suite.testInvalidAccessToken(
append(suite.insecureTraceEndpointOptions(),
WithAccessToken("1234"),
)...,
)
}

func (suite *testSuite) TestInvalidMetricAccessTokenLength() {
suite.testInvalidAccessToken(
append(suite.bothInsecureEndpointOptions(),
WithAccessToken("1234"),
)...,
)
}

func (suite *testSuite) testEndpointDisabled(expected string, opts ...Option) {
lsOtel := ConfigureOpentelemetry(
append(opts,
Expand Down

0 comments on commit 1c65a94

Please sign in to comment.