
Product
Rust Support Now in Beta
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
@3fv/atlassian-oauth-connect
Advanced tools
It's a properly configured hybrid module,
so both commonjs
& module
/esm
runtimes are
supported, which means that both browser
&
node
environments can you the entire
library excluding the decode
functionality,
which I'll eventually convert for browser support
using cryptojs
, but it's transparently functional
in any evironment now
yarn add @3fv/atlassian-oauth-connect
First, make sure you've got direnv
installed via your package manager of choice brew
, apt
, pacman
, etc...
Copy .envrc.templace
to .envrc
and fill in all the missing fields. Also, the scope list is robust
, but the purpose is
to show near every currently available scope, so, go ahead and
pair it down to what you need.
Populate your redirect URI, client id, and client secret with the values you entered/received Atlassian Developer Console when your configured your app
WARNING: As mentioned, this is just an example; in a real world scenario the configuration would come from another system like AWS AppConfig
with appropriate secret management, etc.
First, copy the file: cp .envrc.template .envrc
Next, populate your app's values from the aforementioned Atlassian Developer Console
App Registration.
# IN CASE YOUR SHELL DOESN'T DO THIS FOR YOU
PATH_add $PWD/node_modules/.bin
# SCOPES FOR AUTHORIZATION.
# THEY MUST BE SPACE DELIMITED
export ATLASSIAN_SCOPE="\
read:me \
offline_access \
read:jira-user \
read:jira-work \
write:jira-work \
manage:jira-project \
manage:jira-configuration \
manage:jira-webhook \
read:confluence-content.all \
read:confluence-content.summary \
write:confluence-content \
write:confluence-space \
write:confluence-file \
read:confluence-props \
write:confluence-props \
manage:confluence-project \
manage:confluence-configuration \
search:confluence"
# APP REGISTRATION DETAILS
export ATLASSIAN_REDIRECT_URI=<YOUR_ATLASSIAN_REDIRECT_URI>
export ATLASSIAN_CLIENT_ID=<YOUR_ATLASSIAN_CLIENT_ID>
export ATLASSIAN_CLIENT_SECRET=<YOUR_ATLASSIAN_CLIENT_SECRET>
The example server is a very basic html page and express web server that together function as a fairly complete tooling for testing & verifyingthe atlassian connect integration.
The source is here ./src/example/server.ts & ./src/example/index.html
# Install Deps
yarn
# Build & Run Example Server
yarn example:server:start
Now you can open a browser to http://localhost:4000 and play around
I figured you'd probably get annoyed if this wasn't easy, so it's all scripted
To start up the typescript compiler in watch mode
and server via nodemon
, just run the following
yarn run example:server:dev
getAccessibleResources()
queries for all resources (projects
& spaces
) for which a user accepted grants.
Here's an example response.[
{
"id": "00000000-0000-0000-0000-000000000000",
"url": "https://3fv.atlassian.net",
"name": "3fv",
"scopes": [
"manage:confluence-configuration",
"search:confluence",
"write:confluence-props",
"read:confluence-props",
"write:confluence-file",
"write:confluence-space",
"write:confluence-content",
"read:confluence-content.summary",
"read:confluence-content.all"
],
"avatarUrl": "https://site-admin-avatar-cdn.prod.public.atl-paas.net/avatars/240/triangle.png"
},
{
"id": "00000000-0000-0000-0000-000000000000",
"url": "https://3fv.atlassian.net",
"name": "3fv",
"scopes": [
"manage:jira-configuration",
"manage:jira-project",
"manage:jira-webhook",
"write:jira-work",
"read:jira-work",
"read:jira-user"
],
"avatarUrl": "https://site-admin-avatar-cdn.prod.public.atl-paas.net/avatars/240/triangle.png"
}
]
retrieveAccessToken()
for code to token exchange
getUserProfile()
to retrieve the current user profile.
{
"account_id": "0000000000000",
"email": "aaaa@bbbbbbbb.com",
"name": "Jonathan Glanz",
"picture": "https://secure.gravatar.com/avatar/...",
"account_status": "active",
"last_updated": "2021-11-15T14:49:38.747Z",
"nickname": "Jonathan Glanz",
"locale": "en-US",
"extended_profile": {
"job_title": "Software Engineer",
"team_type": "Software Development"
},
"account_type": "atlassian",
"email_verified": true
}
offline_access
scope) & the expiration data, so you can implement your own refresh token rolling or wait for me to find a reason :grin:atlassian-jwt
package chucks errors when verifying the returned tokens)getUserProfile
, retrieveAccessToken
, etc., every call no matter identical params or not, query the endpoints; so this is kind of importantWritten with love in #NYC by @jglanz 3FV. Enjoy
FAQs
Atlassian Connect OAuth2 library
We found that @3fv/atlassian-oauth-connect demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.