0.0.8 • Published 10 months ago

@forge/auth v0.0.8

Weekly downloads
-
License
SEE LICENSE IN LI...
Repository
-
Last release
10 months ago

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.

0.0.7-next.0

1 year ago

0.0.8-next.0

10 months ago

0.0.8

10 months ago

0.0.7-next.1

1 year ago

0.0.6-next.0

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.3

3 years ago

0.0.5

3 years ago

0.0.5-next.0

3 years ago

0.0.4

3 years ago

0.0.3-next.0

3 years ago

0.0.4-next.1

3 years ago

0.0.4-next.0

3 years ago

0.0.2

3 years ago

0.0.2-next.0

3 years ago

0.0.1

5 years ago

0.0.1-next.2

5 years ago

0.0.1-next.1

5 years ago

0.0.1-next.0

5 years ago