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

@forge/auth

Package Overview
Dependencies
Maintainers
2
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@forge/auth

Supports authorization for product REST API calls

  • 0.0.4
  • npm
  • Socket score

Version published
Weekly downloads
9.6K
decreased by-12.09%
Maintainers
2
Weekly downloads
 
Created
Source

Forge authorization

This package provides methods for app developers to authorize users and entities (issues, pages, etc.) before making asApp product REST API calls.

Example usage in Connect

A small adapter around AP.request to get this library working in Connect apps:

    const authorize = authorizeConfluenceWithFetch((url, { body }) => {
        const res = new Promise((resolve) => {
          addon.httpClient(req).post(
            {
              headers: {
                'X-Atlassian-Token': 'no-check',
                'Content-Type': 'application/json',
              },
              url,
              body,
            },
            (err, response, body) => {
              if (err || response.statusCode >= 400) {
                // read response and reject
              } else {
                resolve(JSON.parse(body));
              }
            },
          );
        });
        return res;
      });

    authorize('5c35519ce6047225b6d54c23')
      .onConfluenceContent(309755905)
      .canUpdate()
      .then((checkResult /* true / false */) => {
        // handle
      }

The consumer would need to handle errors bubbled up from the fetch helper and the @forge/auth library.

FAQs

Package last updated on 15 Aug 2023

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