Skip to content

Commit

Permalink
Fix: make /v1/blob authorizable in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
aopoltorzhicky committed Sep 12, 2024
1 parent 5c21b41 commit 9379741
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 31 deletions.
2 changes: 1 addition & 1 deletion cmd/api/docs/swagger.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 18 additions & 13 deletions cmd/api/handler/namespace.go
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ func (req listBlobsRequest) toDbRequest(ctx context.Context, ns storage.INamespa
// @Param from query integer false "Time from in unix timestamp" mininum(1)
// @Param to query integer false "Time to in unix timestamp" mininum(1)
// @Param signers query string false "Comma-separated celestia addresses"
// @Param namespaces query string false "Comma-separated celestia namespaces"
// @Param namespaces query string false "Comma-separated celestia namespaces"
// @Param cursor query integer false "Last entity id which is used for cursor pagination" mininum(1)
// @Accept json
// @Produce json
Expand Down Expand Up @@ -475,18 +475,23 @@ type postBlobRequest struct {

// Blob godoc
//
// @Summary Get namespace blob by commitment on height
// @Description Returns blob
// @Tags namespace
// @ID get-blob
// @Param hash body string true "Base64-encoded namespace id and version"
// @Param height body integer true "Block heigth" minimum(1)
// @Param commitment body string true "Blob commitment"
// @Accept json
// @Produce json
// @Success 200 {object} responses.Blob
// @Failure 400 {object} Error
// @Router /blob [post]
// @Summary Get namespace blob by commitment on height
// @Description Returns blob
// @Tags namespace
// @ID get-blob
// @Param hash body string true "Base64-encoded namespace id and version"
// @Param height body integer true "Block heigth" minimum(1)
// @Param commitment body string true "Blob commitment"
// @Accept json
// @Produce json
// @Success 200 {object} responses.Blob
// @Failure 400 {object} Error
// @Router /blob [post]
//
// @securityDefinitions.apikey ApiKeyAuth
// @in header
// @name apikey
// @description To authorize your requests you have to select the required tariff on our site. Then you receive api key to authorize. Api key should be passed via request header `apikey`.
func (handler *NamespaceHandler) Blob(c echo.Context) error {
req, err := bindAndValidate[postBlobRequest](c)
if err != nil {
Expand Down
34 changes: 17 additions & 17 deletions cmd/api/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,27 +19,27 @@ var rootCmd = &cobra.Command{
Short: "DipDup Verticals | Celenium API",
}

// @title Celenium API
// @version 1.0
// @description Celenium API is a powerful tool to access all blockchain data that is processed and indexed by our proprietary indexer. With Celenium API you can retrieve all historical data, off-chain data, blobs and statistics through our REST API. Celenium API indexer are open source, which allows you to not depend on third-party services. You can clone, build and run them independently, giving you full control over all components. If you have any questions or feature requests, please feel free to contact us. We appreciate your feedback!
// @host api-mainnet.celenium.io
// @schemes https
// @BasePath /v1
// @title Celenium API
// @version 1.0
// @description Celenium API is a powerful tool to access all blockchain data that is processed and indexed by our proprietary indexer. With Celenium API you can retrieve all historical data, off-chain data, blobs and statistics through our REST API. Celenium API indexer are open source, which allows you to not depend on third-party services. You can clone, build and run them independently, giving you full control over all components. If you have any questions or feature requests, please feel free to contact us. We appreciate your feedback!
// @host api-mainnet.celenium.io
// @schemes https
// @BasePath /v1
//
// @contact.name Support
// @contact.url https://discord.gg/3k83Przqk8
// @contact.email [email protected]
// @contact.name Support
// @contact.url https://discord.gg/3k83Przqk8
// @contact.email [email protected]
//
// @externalDocs.description Full documentation
// @externalDocs.url https://api-docs.celenium.io/
// @externalDocs.description Full documentation
// @externalDocs.url https://api-docs.celenium.io/
//
// @x-servers [{"url": "api-mainnet.celenium.io", "description": "Celenium Mainnet API"},{"url": "api-mocha.celenium.io", "description": "Celenium Mocha API"},{"url": "api-arabica.celenium.io", "description": "Celenium Arabica API"}]
// @query.collection.format multi
// @x-servers [{"url": "api-mainnet.celenium.io", "description": "Celenium Mainnet API"},{"url": "api-mocha.celenium.io", "description": "Celenium Mocha API"},{"url": "api-arabica.celenium.io", "description": "Celenium Arabica API"}]
// @query.collection.format multi
//
// @securityDefinitions.apikey ApiKeyAuth
// @in header
// @name apikey
// @description To authorize your requests you have to select the required tariff on our site. Then you receive api key to authorize. Api key should be passed via request header `apikey`.
// @securityDefinitions.apikey ApiKeyAuth
// @in header
// @name apikey
// @description To authorize your requests you have to select the required tariff on our site. Then you receive api key to authorize. Api key should be passed via request header `apikey`.
func main() {
cfg, err := initConfig()
if err != nil {
Expand Down

0 comments on commit 9379741

Please sign in to comment.