Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove access token length check #412

Merged
merged 1 commit into from
Mar 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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