akiradeveloper / akashic-storage

Filey system backed S3-compatible storage in Scala/Akka-Http
Apache License 2.0
22 stars 2 forks source link

refactor: Define AuthorizeS3v2 directive #81

Closed akiradeveloper closed 8 years ago

akiradeveloper commented 8 years ago

With more functional style, the code will be more succinct

run = autorizeS3v2 { _caller: String =>
  caller = _caller
  super.run
}

val authorizeS3v2: Directive1[String] = extractRequest.map { req =>
  ....
}

POST request can't go along with this. should purge after all

akiradeveloper commented 8 years ago

experimentally implemented (https://github.com/akiradeveloper/akashic-storage/commit/4183d4b30ef1fff337b7d5c0491eadcb52d6b7ca) but not applied.

To apply, the return type of Runnable should be [T <: Route] or Route more specifically. At this time, there is no need the type to be abstract T. So it's good time to restrict the type for more readability

akiradeveloper commented 8 years ago

This issue should be closed after all things are done, including applying the directive and of course check no degradation

akiradeveloper commented 8 years ago

Functional means more rooms to run concurrently because it's applicative.