cgroschupp / go-client-confluent-cloud

MIT License
13 stars 19 forks source link

Add api-key resource_type assignment based on verified conditions #8

Open rjudin opened 4 years ago

rjudin commented 4 years ago

Issue

api-key should have Resource Type, otherwise empty value disallow access to specified resource

Action

Please add resource_type assignment based on verified conditions

Example

3 types of api keys [1] were created:

Verification:

create a topic at lkc-clus1 cluster:


[1] ccloud api-key list

         Key         | Owner  |  Description   | Resource Type | Resource ID  
+--------------------+--------+----------------+---------------+-------------+
    MASKEDMASKED7EHE | 123123 | rj-tf-keys     | cloud         |              
    MASKEDMASKED7S2E | 123456 | TF-to-cluster  |               | lkc-clus1    
    MASKEDMASKED7TR3 | 123456 | CLI-to-cluster | kafka         | lkc-clus1

[2] terraform resource confluentcloud_api_key

resource "confluentcloud_api_key" "this" {
  description = "TF-to-cluster"

  environment_id = confluentcloud_environment.this.id
  cluster_id     = local.cluster_id
  user_id        = confluentcloud_service_account.this.id
}

[3] cli-reference ccloud service-account list

Id | Name | Description
+--------+------------------+--------------------------+ 123456 | DEV-test-sa-test | DEV service account test

ccloud api-key create --resource lkc-clus1 --service-account 123456 --description CLI-to-cluster

rjudin commented 4 years ago

@brunodomenici can you please help with that?

brunodomenici commented 4 years ago

Hi @rjudin, unfortunately I can't work on this right now. I'm not sure I got the issue, but I know that Confluent is changing lots of things on this matter and I think worth wait the official Confluent Cloud REST API version https://confluent.cloud/api/docs