Esempio n. 1
0
    def Run(self, args):
        messages = cloudkms_base.GetMessagesModule()

        policy = iam_util.ParseJsonPolicyFile(args.policy_file,
                                              messages.Policy)

        return iam.SetCryptoKeyIamPolicy(flags.ParseCryptoKeyName(args),
                                         policy)
Esempio n. 2
0
  def Run(self, args):
    messages = cloudkms_base.GetMessagesModule()

    policy, update_mask = iam_util.ParseYamlOrJsonPolicyFile(args.policy_file,
                                                             messages.Policy)

    crypto_key_ref = flags.ParseCryptoKeyName(args)
    result = iam.SetCryptoKeyIamPolicy(crypto_key_ref, policy, update_mask)
    iam_util.LogSetIamPolicy(crypto_key_ref.Name(), 'key')
    return result