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

Add cors headers to components' server admin routes #5351

Merged
merged 9 commits into from
Nov 10, 2022

Conversation

bdoyle0182
Copy link
Contributor

Description

This pr adds cors headers to the server admin routes of each component plus the options route which is needed for pre-flight requests from browsers when auth is included in the request. The reason for this is to lay the ground work for future ui work for an admin portal.

Related issue and scope

  • I opened an issue to propose and discuss this change (#????)

My changes affect the following components

  • API
  • Controller
  • Message Bus (e.g., Kafka)
  • Loadbalancer
  • Scheduler
  • Invoker
  • Intrinsic actions (e.g., sequences, conductors)
  • Data stores (e.g., CouchDB)
  • Tests
  • Deployment
  • CLI
  • General tooling
  • Documentation

Types of changes

  • Bug fix (generally a non-breaking change which closes an issue).
  • Enhancement or new feature (adds new functionality).
  • Breaking change (a bug fix or enhancement which changes existing behavior).

Checklist:

  • I signed an Apache CLA.
  • I reviewed the style guides and followed the recommendations (Travis CI will check :).
  • I added tests to cover my changes.
  • My changes require further changes to the documentation.
  • I updated the documentation where necessary.

@codecov-commenter
Copy link

codecov-commenter commented Nov 8, 2022

Codecov Report

Merging #5351 (eaf84fa) into master (44791f3) will decrease coverage by 4.91%.
The diff coverage is 68.33%.

@@            Coverage Diff             @@
##           master    #5351      +/-   ##
==========================================
- Coverage   81.26%   76.35%   -4.92%     
==========================================
  Files         240      240              
  Lines       14393    14407      +14     
  Branches      603      618      +15     
==========================================
- Hits        11697    11000     -697     
- Misses       2696     3407     +711     
Impacted Files Coverage Δ
...rg/apache/openwhisk/core/controller/RestAPIs.scala 88.09% <ø> (ø)
.../apache/openwhisk/core/controller/WebActions.scala 90.94% <ø> (ø)
...ontainerpool/v2/FunctionPullingContainerPool.scala 80.83% <ø> (ø)
...pache/openwhisk/core/invoker/InvokerReactive.scala 53.90% <ø> (-17.97%) ⬇️
...ache/openwhisk/core/invoker/FPCInvokerServer.scala 48.14% <52.17%> (+2.31%) ⬆️
.../openwhisk/core/scheduler/FPCSchedulerServer.scala 75.00% <75.00%> (-0.87%) ⬇️
.../apache/openwhisk/core/controller/Controller.scala 83.20% <80.00%> (-0.28%) ⬇️
...scala/org/apache/openwhisk/http/CorsSettings.scala 100.00% <100.00%> (ø)
...core/database/cosmosdb/RxObservableImplicits.scala 0.00% <0.00%> (-100.00%) ⬇️
...ore/database/cosmosdb/cache/CacheInvalidator.scala 0.00% <0.00%> (-100.00%) ⬇️
... and 25 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Member

@style95 style95 left a comment

Choose a reason for hiding this comment

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

It generally looks good to me.
BTW, do you have the plan to contribute an admin UI too?

@@ -78,6 +76,7 @@ case class DeletionContainer(deletionMessage: ContainerDeletionMessage)
case object Remove
case class Keep(timeout: FiniteDuration)
case class PrewarmContainer(maxConcurrent: Int)
case object GetState
Copy link
Member

Choose a reason for hiding this comment

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

Is there any reason we should define another GetState here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I see what happened now, I had this in progress for awhile and had a bad merge somewhere with your recent commits. Should all be cleaned up now.

@bdoyle0182
Copy link
Contributor Author

Not at the moment don't have bandwidth to do any ui work, but maybe down the road

@bdoyle0182 bdoyle0182 merged commit 8578887 into apache:master Nov 10, 2022
msciabarra pushed a commit to nuvolaris/openwhisk that referenced this pull request Nov 23, 2022
* add container pool state route to invoker

* scalafmt

* wip

* add cors headers to components server admin routes

* scalafmt

* fix bad merge

Co-authored-by: Brendan Doyle <brendand@qualtrics.com>
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants