Skip to content

Commit

Permalink
Merge pull request #109 from snyk/feat/cleanup-versions
Browse files Browse the repository at this point in the history
Feat: cleanup versions
  • Loading branch information
jgresty authored May 7, 2024
2 parents 00fe45c + c2e9ac9 commit bc1375a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
4 changes: 0 additions & 4 deletions src/lib/types/apiVersion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ export const enum API {
}

export const enum APIVersion {
// Experimental API versions
V20210811exp = '2021-08-11~experimental',
V20220216exp = '2022-02-16~experimental',

// GA API versions
V20230529 = '2023-05-29',
V20231103 = '2023-11-03',
Expand Down
5 changes: 2 additions & 3 deletions src/lib/utils/OAuth2Strategy/OAuth2Strategy.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Request } from 'express';
import { writeToDb } from '../db';
import { EncryptDecrypt } from '../encrypt-decrypt';
import { APIVersion, AuthData, Config, Envars } from '../../types';
import { AuthData, Config, Envars } from '../../types';
import { API_BASE, APP_BASE } from '../../../app';
import { getAppOrgs } from '../apiRequests';
import config from 'config';
Expand Down Expand Up @@ -38,10 +38,9 @@ export function getOAuth2(): OAuth2Strategy {
const clientSecret = process.env[Envars.ClientSecret] as string;
const callbackURL = process.env[Envars.RedirectUri] as string;

// Note: the value of version being manually added
return new OAuth2Strategy(
{
authorizationURL: `${APP_BASE}${config.get(Config.AuthURL)}?version=${APIVersion.V20210811exp}`,
authorizationURL: `${APP_BASE}${config.get(Config.AuthURL)}`,
tokenURL: `${API_BASE}${config.get(Config.TokenURL)}`,
clientID: clientID,
clientSecret: clientSecret,
Expand Down
2 changes: 1 addition & 1 deletion src/lib/utils/apiRequests/getAppOrg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export async function getAppOrgs(tokenType: string, accessToken: string): Promis
accessToken,
)({
method: 'GET',
url: `/orgs?version=${APIVersion.V20220216exp}`,
url: `/orgs?version=${APIVersion.V20231103}`,
});

return {
Expand Down

0 comments on commit bc1375a

Please sign in to comment.