-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make it easier to configure and to disable JWS for delegation (#5065)
* Make it easier to configure and to disable JWS for delegation * Fix test compilation --------- Co-authored-by: Simon Dumas <[email protected]>
- Loading branch information
Showing
18 changed files
with
237 additions
and
150 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
80 changes: 0 additions & 80 deletions
80
...c/main/scala/ch/epfl/bluebrain/nexus/delta/plugins/storage/files/routes/TokenIssuer.scala
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
delta/sdk/src/main/scala/ch/epfl/bluebrain/nexus/delta/sdk/jws/JWSConfig.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package ch.epfl.bluebrain.nexus.delta.sdk.jws | ||
|
||
import ch.epfl.bluebrain.nexus.delta.plugins.storage.jws.RSAUtils | ||
import com.nimbusds.jose.jwk.RSAKey | ||
import pureconfig.generic.auto._ | ||
import pureconfig.generic.semiauto.deriveReader | ||
import pureconfig.{ConfigConvert, ConfigReader} | ||
|
||
import java.security.interfaces.RSAPrivateCrtKey | ||
import scala.concurrent.duration.FiniteDuration | ||
|
||
sealed trait JWSConfig | ||
|
||
object JWSConfig { | ||
final case object Disabled extends JWSConfig | ||
|
||
final case class Enabled(privateKey: RSAPrivateCrtKey, ttl: FiniteDuration) extends JWSConfig { | ||
val rsaKey: RSAKey = RSAUtils.generateRSAKeyFromPrivate(privateKey) | ||
} | ||
|
||
implicit private val privateKeyConvert: ConfigConvert[RSAPrivateCrtKey] = | ||
ConfigConvert.viaStringTry[RSAPrivateCrtKey](RSAUtils.parseRSAPrivateKey, _.toString) | ||
|
||
implicit val delegationReader: ConfigReader[JWSConfig] = deriveReader | ||
} |
Oops, something went wrong.