Skip to content

Commit

Permalink
Remove client dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
nad-au committed Feb 4, 2024
1 parent c50981c commit b945cd8
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 26 deletions.
42 changes: 24 additions & 18 deletions actionstep-auth-function/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion actionstep-auth-function/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
"dependencies": {
"@azure/functions": "^4.0.0",
"@dbc-tech/actionstep": "^1.2.0"
"simple-oauth2": "^5.0.0"
},
"devDependencies": {
"@golevelup/ts-jest": "^0.4.0",
Expand Down
14 changes: 7 additions & 7 deletions actionstep-auth-function/src/utils/create-auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,26 @@ import { blobInput, blobOutput } from '../io/blob.io'
import {
ActionStepClientConfig,
ActionStepToken,
actionStepAuth,
} from '@dbc-tech/actionstep'

} from '../../../actionstep-client/src/types'
import { actionStepAuth } from '../../../actionstep-client/src'
export const createAuth = (
request: HttpRequest,
context: InvocationContext,
) => {
const url = new URL(request.url)
const config: ActionStepClientConfig = {
authorize_url: process.env.ACTIONSTEP_AUTHORIZE_URL!,
client_id: process.env.ACTIONSTEP_CLIENT_ID!,
client_secret: process.env.ACTIONSTEP_CLIENT_SECRET!,
authorize_url: process.env.ACTIONSTEP_AUTHORIZE_URL,
client_id: process.env.ACTIONSTEP_CLIENT_ID,
client_secret: process.env.ACTIONSTEP_CLIENT_SECRET,
redirect_uri: url.origin + url.pathname,
token_url: process.env.ACTIONSTEP_TOKEN_URL!,
token_url: process.env.ACTIONSTEP_TOKEN_URL,
store: {
get: () =>
Promise.resolve(<ActionStepToken>context.extraInputs.get(blobInput)),
set: (token) =>
Promise.resolve(context.extraOutputs.set(blobOutput, token)),
},
api_url: process.env.ACTIONSTEP_API_URL,
}

return actionStepAuth(config)
Expand Down

0 comments on commit b945cd8

Please sign in to comment.