Skip to content

Commit

Permalink
chore: fix example indentation (#187)
Browse files Browse the repository at this point in the history
  • Loading branch information
frankkilcommins authored May 8, 2024
1 parent 0c12c6f commit ca9d9f1
Showing 1 changed file with 55 additions and 56 deletions.
111 changes: 55 additions & 56 deletions examples/1.0.0/oauth.workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -125,60 +125,59 @@ workflows:
redirect_uri:
type: string
description: The redirect uri
steps:
- stepId: browser-authorize
description: >-
This URL is opened in the browser and redirects you back to
the registered redirect URI with an authorization code.
operationId: authorize
parameters:
- name: client_id
in: query
value: $inputs.client_id
- name: redirect_uri
in: query
value: $inputs.redirect_uri
- name: response_type
in: query
value: 'code'
- name: scope
in: query
value: 'read'
- name: state
in: query
value: '12345'
successCriteria:
- condition: $statusCode == 200
- context: $response.body
condition: $.access_token != null
type: JSONPath
outputs:
code: $response.body.code # Not really, this is a query parameter

- stepId: get-access-token
description: >-
This is where you get the token
operationId: get-token
requestBody:
contentType: application/x-www-form-urlencoded
payload:
grant_type: authorization_code
code: $steps.browser-authorize.outputs.code
redirect_uri: $inputs.redirect_uri
client_id: $inputs.client_id
client_secret: $inputs.client_secret
successCriteria:
- condition: $statusCode == 200
- context: $response.body
condition: $.access_token != null
type: JSONPath
outputs:
access_token: $response.body.access_token
refresh_token: $response.body.refresh_token
expires_in: $response.body.expires_in

outputs:
access_token: $steps.get-access-token.outputs.access_token
refresh_token: $steps.get-access-token.outputs.refresh_token
expires_in: $steps.get-access-token.outputs.expires_in
steps:
- stepId: browser-authorize
description: >-
This URL is opened in the browser and redirects you back to
the registered redirect URI with an authorization code.
operationId: authorize
parameters:
- name: client_id
in: query
value: $inputs.client_id
- name: redirect_uri
in: query
value: $inputs.redirect_uri
- name: response_type
in: query
value: 'code'
- name: scope
in: query
value: 'read'
- name: state
in: query
value: '12345'
successCriteria:
- condition: $statusCode == 200
- context: $response.body
condition: $.access_token != null
type: JSONPath
outputs:
code: $response.body.code # Not really, this is a query parameter

- stepId: get-access-token
description: >-
This is where you get the token
operationId: get-token
requestBody:
contentType: application/x-www-form-urlencoded
payload:
grant_type: authorization_code
code: $steps.browser-authorize.outputs.code
redirect_uri: $inputs.redirect_uri
client_id: $inputs.client_id
client_secret: $inputs.client_secret
successCriteria:
- condition: $statusCode == 200
- context: $response.body
condition: $.access_token != null
type: JSONPath
outputs:
access_token: $response.body.access_token
refresh_token: $response.body.refresh_token
expires_in: $response.body.expires_in
outputs:
access_token: $steps.get-access-token.outputs.access_token
refresh_token: $steps.get-access-token.outputs.refresh_token
expires_in: $steps.get-access-token.outputs.expires_in

0 comments on commit ca9d9f1

Please sign in to comment.