Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

github.com/markarts/kivik-couchdb-cloudant

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/markarts/kivik-couchdb-cloudant

  • v0.0.0-20210226120651-2b66c6855231
  • Source
  • Go
  • Socket score

Version published
Created
Source

Kivik Couchdb Cloudant Authenticator

This package provides a basic implementation of IBM IAM auhtenticationg for cloudant.

How to use

package main

import (
	"context"

	iam "github.com/MarkArts/kivik-couchdb-cloudant/authenticator"
	_ "github.com/go-kivik/couchdb/v4"
	"github.com/go-kivik/kivik/v4"
)

func main() {
	fmt.PrintLhn(setup("https://example.com", "iam APi key"))
}

func setup(cloudantDSN string, apiKey string) error {
	client, err := kivik.New("couch", cloudantDSN)
	if err != nil {
		return nil, err
	}

	iamAuthenticator, err := iam.NewIAMAuthenticator(apiKey)
	if err != nil {
		return nil, err
	}

	err = client.Authenticate(context.TODO(), iamAuthenticator)
	if err != nil {
		return nil, err
	}
}

Limitations

Replication

Most likely using kivik's replication functions won't work as Cloudant replication works with a different auth mechanism.

Refresh tokens

This lib doesn't use the refresh tokens as they are only valid for a month which means your app won't be able to run longer then a month without restart.

FAQs

Package last updated on 26 Feb 2021

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc