You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openwhisk.apache.org by ra...@apache.org on 2017/07/24 11:31:05 UTC

[incubator-openwhisk] branch master updated: Add check that key is at most 64 characters (#2521)

This is an automated email from the ASF dual-hosted git repository.

rabbah pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk.git


The following commit(s) were added to refs/heads/master by this push:
     new 6b9035a  Add check that key is at most 64 characters (#2521)
6b9035a is described below

commit 6b9035a748cd25cd3d76b004b68df16a3c3f4d43
Author: Christian Bickel <gi...@cbickel.de>
AuthorDate: Mon Jul 24 13:31:02 2017 +0200

    Add check that key is at most 64 characters (#2521)
---
 common/scala/src/main/scala/whisk/core/entity/Secret.scala | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/common/scala/src/main/scala/whisk/core/entity/Secret.scala b/common/scala/src/main/scala/whisk/core/entity/Secret.scala
index 08ee145..196dd87 100644
--- a/common/scala/src/main/scala/whisk/core/entity/Secret.scala
+++ b/common/scala/src/main/scala/whisk/core/entity/Secret.scala
@@ -42,6 +42,9 @@ protected[core] object Secret extends ArgNormalizer[Secret] {
     /** Minimum secret length */
     private val MIN_LENGTH = 64
 
+    /** Maximum secret length */
+    private val MAX_LENGTH = 64
+
     /**
      * Creates a Secret from a string. The string must be a valid secret already.
      *
@@ -52,6 +55,7 @@ protected[core] object Secret extends ArgNormalizer[Secret] {
     @throws[IllegalArgumentException]
     override protected[entity] def factory(str: String): Secret = {
         require(str.length >= MIN_LENGTH, s"secret must be at least $MIN_LENGTH characters")
+        require(str.length <= MAX_LENGTH, s"secret must be at most $MAX_LENGTH characters")
         new Secret(str)
     }
 

-- 
To stop receiving notification emails like this one, please contact
['"commits@openwhisk.apache.org" <co...@openwhisk.apache.org>'].