nasa / nasa/python_cmr

Provide convenience method for adding a client-id header

Open
#49 1 comment 2 reactions 0 assignees View on GitHub

@Sharvin-M is already working on this.

Since Jan 14, 2025.

  • #97 by @Sharvin-M — open
enhancement good first issue
Dominant language
Python
Stars
29
Forks
32
Avg merge
19h 6m
Merged PRs (30d)
1

Description

The Headers section of the CMR Search API documentation describes the Client-Id header as follows:

Client-Id - Indicates a name for the client using the CMR API. Specifying this helps Operations monitor query performance per client. It can also make it easier for them to identify your requests if you contact them for assistance.

Given that there are token and bearer_token methods in the Query class for conveniently setting the Authorization header, providing a client_id method would be convenient for supplying the Client-Id header.

Further, I recommend the following:

  • When the user does not invoke the client_id method to specify their own chosen ID for identification for assistance, a default should be set. I recommend something like this: python_cmr-vX.Y.Z, where X.Y.Z is the version of python_cmr
  • When the user does invoke the client_id method, the following suffix should be added to the value specified by the user: (python_cmr-vX.Y.Z), with a space character between the user-supplied value and the suffix.

Contributor guide

No contributing guide indexed for this repository

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 in the Query class beside the existing token and bearer_token methods, then check how the python_cmr package version is exposed. Done means a client_id convenience method sets Client-Id with the requested default or version suffix behavior, with coverage for both user-supplied and default IDs.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.