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

chore(logs): allow anonymous call to front50 to get pipelines #1091

Merged
merged 2 commits into from
Mar 18, 2021

Conversation

dbyron0
Copy link
Contributor

@dbyron0 dbyron0 commented Mar 17, 2021

to clean up warnings like:

2021-03-17 22:51:04.801  WARN 1 --- [oScheduler-1063] c.n.s.okhttp.OkHttp3MetricsInterceptor   : Request GET:http://spin-front50.spinnaker-stage:8080/pipelines?restricted=false is missing [X-SPINNAKER-USER, X-SPINNAKER-ACCOUNTS] authentication headers and will be treated as anonymous.
Request from: com.netflix.spinnaker.okhttp.MetricsInterceptor.doIntercept(MetricsInterceptor.java:98)
	at com.netflix.spinnaker.okhttp.OkHttp3MetricsInterceptor.intercept(OkHttp3MetricsInterceptor.java:36)
	at com.netflix.spinnaker.echo.telemetry.PipelineCountsDataProvider.retrievePipelines(PipelineCountsDataProvider.kt:48)
	at com.netflix.spinnaker.echo.telemetry.PipelineCountsDataProvider.access$retrievePipelines(PipelineCountsDataProvider.kt:30)
	at com.netflix.spinnaker.echo.telemetry.PipelineCountsDataProvider$appPipelinesSupplier$1.get(PipelineCountsDataProvider.kt:33)
	at com.netflix.spinnaker.echo.telemetry.PipelineCountsDataProvider$appPipelinesSupplier$1.get(PipelineCountsDataProvider.kt:30)
	at com.netflix.spinnaker.echo.telemetry.PipelineCountsDataProvider.populateData(PipelineCountsDataProvider.kt:38)
	at com.netflix.spinnaker.echo.telemetry.TelemetryEventListener.processEvent(TelemetryEventListener.java:94)
	at com.netflix.spinnaker.echo.events.EventPropagator.lambda$processEvent$0(EventPropagator.java:71)
	at com.netflix.spinnaker.security.AuthenticatedRequest.lambda$wrapCallableForPrincipal$0(AuthenticatedRequest.java:272)
	at com.netflix.spinnaker.echo.events.EventPropagator.lambda$processEvent$2(EventPropagator.java:78)

@@ -22,6 +22,7 @@ dependencies {
implementation project(':echo-core')
implementation "com.netflix.spinnaker.kork:kork-jedis"
implementation 'com.google.protobuf:protobuf-java-util'
implementation "com.netflix.spinnaker.kork:kork-exceptions"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems unrelated?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is where com.netflix.spinnaker.security.AuthenticatedRequest lives...The code doesn't compile without it. https://github.com/spinnaker/kork/blob/master/kork-security/src/main/java/com/netflix/spinnaker/security/AuthenticatedRequest.java

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

or maybe...I'm getting this wrong and have copy-pasted from other similar changes...gimme a minute.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, it does in fact compile with nothing additional here. I think it's correct to add

implementation "com.netflix.spinnaker.kork:kork-security"

instead of kork-exceptions though, since kork-security is actually where AuthenticatedRequest lives....like this: 8021a56

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching this btw!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, looking good now 👍

David Byron added 2 commits March 18, 2021 15:01
to clean up warnings like:

2021-03-17 22:51:04.801  WARN 1 --- [oScheduler-1063] c.n.s.okhttp.OkHttp3MetricsInterceptor   : Request GET:http://spin-front50.spinnaker-stage:8080/pipelines?restricted=false is missing [X-SPINNAKER-USER, X-SPINNAKER-ACCOUNTS] authentication headers and will be treated as anonymous.
Request from: com.netflix.spinnaker.okhttp.MetricsInterceptor.doIntercept(MetricsInterceptor.java:98)
	at com.netflix.spinnaker.okhttp.OkHttp3MetricsInterceptor.intercept(OkHttp3MetricsInterceptor.java:36)
	at com.netflix.spinnaker.echo.telemetry.PipelineCountsDataProvider.retrievePipelines(PipelineCountsDataProvider.kt:48)
	at com.netflix.spinnaker.echo.telemetry.PipelineCountsDataProvider.access$retrievePipelines(PipelineCountsDataProvider.kt:30)
	at com.netflix.spinnaker.echo.telemetry.PipelineCountsDataProvider$appPipelinesSupplier$1.get(PipelineCountsDataProvider.kt:33)
	at com.netflix.spinnaker.echo.telemetry.PipelineCountsDataProvider$appPipelinesSupplier$1.get(PipelineCountsDataProvider.kt:30)
	at com.netflix.spinnaker.echo.telemetry.PipelineCountsDataProvider.populateData(PipelineCountsDataProvider.kt:38)
	at com.netflix.spinnaker.echo.telemetry.TelemetryEventListener.processEvent(TelemetryEventListener.java:94)
	at com.netflix.spinnaker.echo.events.EventPropagator.lambda$processEvent$0(EventPropagator.java:71)
	at com.netflix.spinnaker.security.AuthenticatedRequest.lambda$wrapCallableForPrincipal$0(AuthenticatedRequest.java:272)
	at com.netflix.spinnaker.echo.events.EventPropagator.lambda$processEvent$2(EventPropagator.java:78)
@dreynaud dreynaud added the ready to merge Approved and ready for merge label Mar 18, 2021
@mergify mergify bot merged commit b42e547 into spinnaker:master Mar 18, 2021
@mergify mergify bot added the auto merged label Mar 18, 2021
@dbyron0 dbyron0 deleted the clean_up_warnings branch March 18, 2021 22:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants