How to secure rest api in golang

How we can secured golang api .

what are the method if it is http/https and grpc protocol

Hi, @Shweta-hlf, can you clarify what you mean by “secure?” Is this a general question about security best practices, or are you looking for something more specific, such as books/blogs/tutorials/packages for authentication/authorization or something else?

Thanks a lot skillian for your quick response.
I am new in golang.We are initial level of designing of our production based golang rest api(http/https/grpc).
so I want to understand the best scurity pracitces for our golang rest api.What are the best way to achive security on rest api implementation.Can you please provide packages and some latest tutorial?
Kindly guide.

I mean - are you asking about TLS? Or how to implement a JWT-based auth scheme? Both? Maybe start here:

For more JWT resources, check the docs on this package: