WEEK 7: ENTRY 3

 At my internship today, I was tasked to write a GET Request Golang code to the Elasticsearch API. Having written a GET request previously for the BigQuery API, I thought it would be an easy and fast task to complete. However, it was the total opposite. With the Elasticsearch Rest API, I had to use a Golang package that could use my SSO Auth token to be able to have the permission to call the API, and to my surprise it is turning out to be more difficult than I previously envisioned. Because of security reasons, not all system users are granted permission to make an API call. I did not realize this until I made an API GET Request. From the look at my code, everything seems  correct, but when I pushed my code and took a look at my logs on the console, there was a 403 error code, which simply means unauthorize. 


Even after the admin authorized my system user to make API calls, my code was not working still. I had to use a different approach. I tried testing my http client with a Big Query API call and that worked, so it narrowed down my issue because clearly the http client is correct. For a moment, I thought perhaps, my Go package version was not compatible with the Elasticsearch API version. But again, when I searched about that, it did indicate that the version’s package does not matter. So then what is going wrong? I am still asking myself that question and hoping that I’ll find the answer soon. 


Basically, I intend to look into the issue this weekend during my spare time so that I can have a fresh thinking and approach. I’ll also do more reading with the other Golang package alternatives. So too, my manager gave me some informal feedback on how I always seem to be stuck at one approach, so it’ll be something I’ll be working on next week. I’ll basically try to change my approach on how I tackle issues by adopting a step-by-step approach while considering the pros and cons of my approach. 


Comments

Popular posts from this blog

WEEK 4: ENTRY 3

WEEK 6: ENTRY 3

WEEK 7: ENTRY 1