Implement a custom authentication class called TimestampedBasicAuth by subclassing requests.auth.AuthBase …
Implement a custom authentication class called TimestampedBasicAuth by subclassing requests.auth.AuthBase …: a task in repo2rlenv-code-instruct (Harbor dataset). The class constructor takes username (str) and password (str). When called on a requests.PreparedRequest , it must: 1. Set the…
The task
The class constructor takes `username` (str) and `password` (str). When called on a `requests.PreparedRequest`, it must: 1. Set the `Authorization` header using `requests.auth.HTTPBasicAuth`. 2. Set `X-Auth-Timestamp` to the current UTC time in `"%Y-%m-%dT%H:%M:%SZ"` format. 3. Set `X-Auth-Signature` to…
Part of FineEnvs/repo2rlenv-code-instruct.