Skip to content

Commit 1717e92

Browse files
ryanmatsrsamborski
authored andcommitted
random generation of keyring / cryptokey names [(#786)](#786)
* random generation of keyring / cryptokey names * Fixed formatting of keyring name and cryptokey name
1 parent 476f4cd commit 1717e92

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

kms/snippets/snippets_test.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1414
# See the License for the specific language governing permissions and
1515

16+
import random
17+
import string
18+
1619
from googleapiclient import discovery
1720

1821
import snippets
@@ -22,10 +25,12 @@
2225
LOCATION = 'global'
2326

2427
# Your Google Cloud Platform KeyRing name
25-
KEYRING = 'sample-keyring-43'
28+
KEYRING = ''.join(
29+
random.choice(string.ascii_lowercase + string.digits) for _ in range(12))
2630

2731
# Your Google Cloud Platform CryptoKey name
28-
CRYPTOKEY = 'sample-key-43'
32+
CRYPTOKEY = ''.join(
33+
random.choice(string.ascii_lowercase + string.digits) for _ in range(12))
2934

3035
# Your Google Cloud Platform CryptoKeyVersion name
3136
VERSION = 1

0 commit comments

Comments
 (0)