oracle / oracle/oci-python-sdk

MyCustomerSecretKey is missing secret_key (secretKey)

Open
#768 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Identity Domains
Dominant language
Python
Stars
474
Forks
321
Avg merge
23m
Merged PRs (30d)
4

Description

Model MyCustomerSecretKey does not include secret_key attribute though it is absolutely returned from the API. I see secret_key is included in CustomerSecretKey model. In both cases the API documentation does not show secret_key is a return value though it absolutely is. Frankly, if it were not in the return the API would be pointless as creating a new key without being able to retrieve the new value is of no use.

Consider this example:

identity_domain_client = oci.identity_domains.IdentityDomainsClient(
    config, signer=signer, service_endpoint=domain.url
)
new_key = oci.identity_domains.models.MyCustomerSecretKey(
    display_name="SDK",
    schemas=["urn:ietf:params:scim:schemas:oracle:idcs:customerSecretKey"],
)
resp = identity_domain_client.create_my_customer_secret_key(
    my_customer_secret_key=new_key,
)

resp.data.display_name
'SDK'

resp.data.access_key
'bc8309f45128a4658b18d38fff3997d605d7c380'

resp.data.secret_key
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'MyCustomerSecretKey' object has no attribute 'secret_key'

…however, this works:

endpoint = "/admin/v1/MyCustomerSecretKeys"
body = {
    "displayName": "REST",
    "schemas": ["urn:ietf:params:scim:schemas:oracle:idcs:customerSecretKey"],
}
resp = requests.post(domain.url + endpoint, auth=signer, json=body)
jsonresp = json.loads(resp.content)

jsonresp["displayName"]
'REST'

jsonresp["accessKey"]
'e74aec6e2317b972691986696403f0b175f60880'

jsonresp["secretKey"]
'tXaYYB0gFUF2/4UthIyYZqCh4Y5tQ3Sp2lxVJKvF+RI='

…so obviously the value for secretKey (or secret_key) should be in the response (as I say, otherwise, what's the point of creating the key?).

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the Python model definition for MyCustomerSecretKey and compare it with CustomerSecretKey, then reproduce the create_my_customer_secret_key example from the issue. Done means the SDK response exposes secret_key consistently with the API's secretKey value and the relevant model behavior or documentation is updated.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.