Skip to content

Commit 94b0198

Browse files
bazarnovbnchrch
andauthored
fix: (DeclarativeOAuthFlow) - make the extract_output Optional; correct the descriptions (#106)
Co-authored-by: Ben Church <[email protected]>
1 parent d04ea8a commit 94b0198

File tree

2 files changed

+52
-12
lines changed

2 files changed

+52
-12
lines changed

protocol-models/src/main/resources/airbyte_protocol/airbyte_protocol.yaml

+26-6
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,6 @@ definitions:
663663
required:
664664
- consent_url
665665
- access_token_url
666-
- extract_output
667666
properties:
668667
consent_url:
669668
type: string
@@ -673,7 +672,7 @@ definitions:
673672
674673
Examples:
675674
{
676-
"consent_url": "https://domain.host.com/oauth2/authorize?{client_id_key}={{client_id_key}}&{redirect_uri_key}={urlEncoder:{{redirect_uri_key}}}&{scope_key}={urlEncoder:{{scope_key}}}&{state_key}={{state_key}}&subdomain={subdomain}"
675+
"consent_url": "https://domain.host.com/oauth2/authorize?{{ client_id_key }}={{ client_id_value }}&{{ redirect_uri_key }}={{ {{redirect_uri_value}} | urlEncoder }}&{{ scope_key }}={{ {{scope_key}} | urlEncoder }}&{{ state_key }}={{ state_value }}&subdomain={{ subdomain }}"
677676
}
678677
scope:
679678
type: string
@@ -692,7 +691,7 @@ definitions:
692691
693692
Examples:
694693
{
695-
"access_token_url": https://auth.host.com/oauth2/token?{client_id_key}={{client_id_key}}&{client_secret_key}={{client_secret_key}}&{auth_code_key}={{auth_code_key}}&{redirect_uri_key}={urlEncoder:{{redirect_uri_key}}}
694+
"access_token_url": "https://auth.host.com/oauth2/token?{{ client_id_key }}={{ client_id_value }}&{{ client_secret_key }}={{ client_secret_value }}&{{ auth_code_key }}={{ auth_code_value }}&{{ redirect_uri_key }}={{ {{redirect_uri_key}} | urlEncoder }}"
696695
}
697696
access_token_headers:
698697
type: object
@@ -706,7 +705,7 @@ definitions:
706705
707706
{
708707
"access_token_headers": {
709-
"Authorization": "Basic {base64Encoder:{client_id}:{client_secret}}"
708+
"Authorization": "Basic {{ {{ client_id_value }}:{{ client_secret_value }} | base64Encoder }}"
710709
}
711710
}
712711
access_token_params:
@@ -720,7 +719,7 @@ definitions:
720719
{
721720
"access_token_params": {
722721
"my_query_param": "param_value",
723-
"{client_id_key}": {{client_id_key}}
722+
"{{ client_id_key }}": "{{ client_id_value }}"
724723
}
725724
}
726725
extract_output:
@@ -810,6 +809,15 @@ definitions:
810809
{
811810
"redirect_uri_key": "my_custom_redirect_uri_key_name"
812811
}
812+
token_expiry_key:
813+
type: string
814+
description: |-
815+
The OAuth Specific optional override to provide the custom key name to something like `expires_at`, if required by data-provider.
816+
817+
Examples:
818+
{
819+
"token_expiry_key": "expires_at"
820+
}
813821
existingJavaType: com.fasterxml.jackson.databind.JsonNode
814822
complete_oauth_output_specification:
815823
description: |-
@@ -819,11 +827,23 @@ definitions:
819827
For each field, a special annotation `path_in_connector_config` can be specified to determine where to merge it,
820828
821829
Examples:
830+
With a `refresh_token` in the `oauth response`:
822831
823832
complete_oauth_output_specification={
824833
refresh_token: {
825834
type: string,
826-
path_in_connector_config: ['credentials', 'refresh_token']
835+
path_in_connector_config: ['credentials', 'refresh_token'],
836+
path_in_oauth_response: ['refresh_token']
837+
}
838+
}
839+
840+
With a nested `refresh_token` under the `data` object, in the `oauth response`:
841+
842+
complete_oauth_output_specification={
843+
refresh_token: {
844+
type: string,
845+
path_in_connector_config: ['credentials', 'refresh_token'],
846+
path_in_oauth_response: ['data', 'refresh_token']
827847
}
828848
}
829849
type: object

protocol-models/src/main/resources/airbyte_protocol/v0/airbyte_protocol.yaml

+26-6
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,6 @@ definitions:
718718
required:
719719
- consent_url
720720
- access_token_url
721-
- extract_output
722721
properties:
723722
consent_url:
724723
type: string
@@ -728,7 +727,7 @@ definitions:
728727
729728
Examples:
730729
{
731-
"consent_url": "https://domain.host.com/oauth2/authorize?{client_id_key}={{client_id_key}}&{redirect_uri_key}={urlEncoder:{{redirect_uri_key}}}&{scope_key}={urlEncoder:{{scope_key}}}&{state_key}={{state_key}}&subdomain={subdomain}"
730+
"consent_url": "https://domain.host.com/oauth2/authorize?{{ client_id_key }}={{ client_id_value }}&{{ redirect_uri_key }}={{ {{redirect_uri_value}} | urlEncoder }}&{{ scope_key }}={{ {{scope_key}} | urlEncoder }}&{{ state_key }}={{ state_value }}&subdomain={{ subdomain }}"
732731
}
733732
scope:
734733
type: string
@@ -747,7 +746,7 @@ definitions:
747746
748747
Examples:
749748
{
750-
"access_token_url": https://auth.host.com/oauth2/token?{client_id_key}={{client_id_key}}&{client_secret_key}={{client_secret_key}}&{auth_code_key}={{auth_code_key}}&{redirect_uri_key}={urlEncoder:{{redirect_uri_key}}}
749+
"access_token_url": "https://auth.host.com/oauth2/token?{{ client_id_key }}={{ client_id_value }}&{{ client_secret_key }}={{ client_secret_value }}&{{ auth_code_key }}={{ auth_code_value }}&{{ redirect_uri_key }}={{ {{redirect_uri_key}} | urlEncoder }}"
751750
}
752751
access_token_headers:
753752
type: object
@@ -761,7 +760,7 @@ definitions:
761760
762761
{
763762
"access_token_headers": {
764-
"Authorization": "Basic {base64Encoder:{client_id}:{client_secret}}"
763+
"Authorization": "Basic {{ {{ client_id_value }}:{{ client_secret_value }} | base64Encoder }}"
765764
}
766765
}
767766
access_token_params:
@@ -775,7 +774,7 @@ definitions:
775774
{
776775
"access_token_params": {
777776
"my_query_param": "param_value",
778-
"{client_id_key}": {{client_id_key}}
777+
"{{ client_id_key }}": "{{ client_id_value }}"
779778
}
780779
}
781780
extract_output:
@@ -865,6 +864,15 @@ definitions:
865864
{
866865
"redirect_uri_key": "my_custom_redirect_uri_key_name"
867866
}
867+
token_expiry_key:
868+
type: string
869+
description: |-
870+
The OAuth Specific optional override to provide the custom key name to something like `expires_at`, if required by data-provider.
871+
872+
Examples:
873+
{
874+
"token_expiry_key": "expires_at"
875+
}
868876
existingJavaType: com.fasterxml.jackson.databind.JsonNode
869877
complete_oauth_output_specification:
870878
description: |-
@@ -874,11 +882,23 @@ definitions:
874882
For each field, a special annotation `path_in_connector_config` can be specified to determine where to merge it,
875883
876884
Examples:
885+
With a `refresh_token` in the `oauth response`:
877886
878887
complete_oauth_output_specification={
879888
refresh_token: {
880889
type: string,
881-
path_in_connector_config: ['credentials', 'refresh_token']
890+
path_in_connector_config: ['credentials', 'refresh_token'],
891+
path_in_oauth_response: ['refresh_token']
892+
}
893+
}
894+
895+
With a nested `refresh_token` under the `data` object, in the `oauth response`:
896+
897+
complete_oauth_output_specification={
898+
refresh_token: {
899+
type: string,
900+
path_in_connector_config: ['credentials', 'refresh_token'],
901+
path_in_oauth_response: ['data', 'refresh_token']
882902
}
883903
}
884904
type: object

0 commit comments

Comments
 (0)