You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

github.com/shoppingdem/api

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/shoppingdem/api

v0.0.0-20241205091712-5d71aee79cdd
Source
Go
Version published
Created
Source

Shopping API

This project is a Shopping API built with Go, using the Gin framework and Okta for authentication.

Setup and Installation

Prerequisites

  • Go (version 1.23.3 or later)
  • Git

Clone the Repository

git clone https://github.com/ShoppingDem/api.git
cd apigo get -u github.com/gin-gonic/gin

Install Dependencies

go get -u github.com/swaggo/swag/cmd/swag
go get -u github.com/swaggo/gin-swagger
go get -u github.com/swaggo/files
go get -u github.com/okta/okta-jwt-verifier-golang
go get -u github.com/joho/godotenv

Generate Swagger Documentation

swag init

Set Up Environment Variables

OKTA_ISSUER=https://{yourOktaDomain}/oauth2/default OKTA_CLIENT_ID={yourClientId}

Build and Run

go build -o api ./api

API Documentation

Security

This API uses Okta for authentication. All protected endpoints require a valid Okta token to be included in the request header.

GET /api/protected HTTP/1.1 Host: localhost:8080 Authorization: Bearer your_okta_token_here

Replace your_okta_token_here with a valid Okta token.

Swagger Documentation

http://localhost:8080/swagger/index.html

Additional Information

This README.md file now includes all the necessary information for setting up the project, understanding the API documentation, and using the authentication system. The security definitions from the selected code are incorporated into the "API Documentation" section.

FAQs

Package last updated on 05 Dec 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts