Closed InsomniaDev closed 2 years ago
Hi @InsomniaDev. I did review your PR, and if you don't mind, could you please implement the following changes:
SchemaRegistryClient
credentials
SetBearerToken
httpRequest
if client.credentials != nil { if len(client.credentials.username) > 0 && len(client.credentials.password) > 0 { req.SetBasicAuth(client.credentials.username, client.credentials.password) } else if len(client.credentials.bearerToken) > 0 { req.Header.Add("Authorization", "Bearer "+client.credentials.bearerToken) } }
I think this way improves the code's readability.
Thanks,
— @riferrei
@riferrei - updated and also added comments in the code to aid with readability.
Hi @InsomniaDev. I did review your PR, and if you don't mind, could you please implement the following changes:
SchemaRegistryClient
struct to thecredentials
struct.SetBearerToken
to write is data to the internal credentials struct.httpRequest
to include a logic like the below:I think this way improves the code's readability.
Thanks,
— @riferrei