syndesisio / syndesis-rest

The API for Syndesis - a flexible, customizable, cloud-hosted platform that provides core integration capabilities as a service. It leverages Red Hat's existing product architecture using OpenShift Online/Dedicated and Fuse Integration Services.
https://syndesis-staging.b6ff.rh-idev.openshiftapps.com/api/v1/
Apache License 2.0
6 stars 17 forks source link

accessToken field in example twitter connection has no displayName field #264

Closed gashcrumb closed 7 years ago

gashcrumb commented 7 years ago

So it shows up as accessToken in the UI. Also a description would be good.

KurtStam commented 7 years ago

@gashcrumb, We seem to have it as:

       "accessToken": {
          "kind": "property",
          "displayName": "Access Token",
          "group": "security",
          "label": "security",
          "required": false,
          "type": "string",
          "javaType": "java.lang.String",
          "deprecated": false,
          "secret": true,
          "description": "The access token"
        },

That seems ok no? I wonder what's going on..

gashcrumb commented 7 years ago

I think it's wrong in the twitter connector vs. the current twitter connection. Have a look at the create connection flow on staging, pick the twitter connector and you'll see accessToken looks like, well, accessToken.

KurtStam commented 7 years ago

@gashcrumb the raw response from /api/v1/connectors/twitter is


    {
        "icon": "fa-twitter",
        "properties":
        {
            "accessToken":
            {
                "kind": "property",
                "displayName": "Access Token",
                "group": "security",
                "label": "security",
                "required": false,
                "type": "string",
                "javaType": "java.lang.String",
                "deprecated": false,
                "secret": true,
                "description": "The access token"
            },
            " accessTokenSecret":
            {
                "kind": "property",
                "displayName": "Access Token Secret",
                "group": "security",
                "label": "security",
                "required": false,
                "type": "string",
                "javaType": "java.lang.String",
                "deprecated": false,
                "secret": true,
                "description": "The access token secret"
            },
            " consumerKey":
            {
                "kind": "property",
                "displayName": "Consumer Key",
                "group": "security",
                "label": "security",
                "required": false,
                "type": "string",
                "javaType": "java.lang.String",
                "deprecated": false,
                "secret": true,
                "description": "The consumer key"
            },
            " consumerSecret":
            {
                "kind": "property",
                "displayName": "Consumer Secret",
                "group": "security",
                "label": "security",
                "required": false,
                "type": "string",
                "javaType": "java.lang.String",
                "deprecated": false,
                "secret": true,
                "description": "The consumer secret"
            }
        },
        "description": "Twitter Connector",
        "actions":
        [
            {
                "properties":
                {
                },
                "description": "Search for tweets that mention you",
                "camelConnectorGAV": "com.redhat.ipaas:twitter-mention-connector:0.3.3",
                "camelConnectorPrefix": "twitter-mention",
                "inputDataShape":
                {
                    "dataType": "none"
                },
                "outputDataShape":
                {
                    "dataType": "java:twitter4j.Status"
                },
                "id": "org.foo:twitter-mention-connector:latest",
                "name": "Mention"
            },
            {
                "properties":
                {
                },
                "description": "Search tweets based one or more keywords",
                "camelConnectorGAV": "com.redhat.ipaas:twitter-search-connector:0.3.3",
                "camelConnectorPrefix": "twitter-search",
                "id": "org.foo:twitter-search-connector:latest",
                "name": "Search"
            },
            {
                "properties":
                {
                },
                "description": "Creates a new tweet",
                "camelConnectorGAV": "com.redhat.ipaas:twitter-tweet-connector:0.3.3",
                "camelConnectorPrefix": "twitter-tweet",
                "id": "org.foo:twitter-tweet-connector:latest",
                "name": "Send a Tweet"
            },
            {
                "properties":
                {
                },
                "description": "Direct message a specific user",
                "camelConnectorGAV": "com.redhat.ipaas:twitter-directmessage-connector:0.3.3",
                "camelConnectorPrefix": "twitter-directmessage",
                "id": "org.foo:twitter-directmessage-connector:latest",
                "name": "Send a Direct Message"
            },
            {
                "properties":
                {
                },
                "description": "Retrieve tweets from my timeline",
                "camelConnectorGAV": "com.redhat.ipaas:twitter-mytimeline-connector:0.3.3",
                "camelConnectorPrefix": "twitter-mytimeline",
                "id": "org.foo:twitter-mytimeline-connector:latest",
                "name": "Get My Timeline"
            },
            {
                "properties":
                {
                },
                "description": "Retrieve tweets from another user's timeline",
                "camelConnectorGAV": "com.redhat.ipaas:twitter-usertimeline-connector:0.3.3",
                "camelConnectorPrefix": "twitter-usertimeline",
                "id": "org.foo:twitter-usertimeline-connector:latest",
                "name": "Get A Timeline"
            },
            {
                "properties":
                {
                },
                "description": "Retrieve tweets which retweet one of my tweets",
                "camelConnectorGAV": "com.redhat.ipaas:twitter-retweets-connector:0.3.3",
                "camelConnectorPrefix": "twitter-retweets",
                "id": "org.foo:twitter-retweets-connector:latest",
                "name": "Get Retweets"
            }
        ],
        "id": "twitter",
        "name": "Twitter"
    }

Are you making a different request?

gashcrumb commented 7 years ago

Yep, actually using the results as it comes back from /api/v1/connectors which has:

accessToken : {type: "string"}

On Thu, Mar 30, 2017 at 12:32 PM, Kurt T Stam notifications@github.com wrote:

@gashcrumb https://github.com/gashcrumb the raw response from /api/v1/connectors/twitter is

{
    "icon": "fa-twitter",
    "properties":
    {
        "accessToken":
        {
            "kind": "property",
            "displayName": "Access Token",
            "group": "security",
            "label": "security",
            "required": false,
            "type": "string",
            "javaType": "java.lang.String",
            "deprecated": false,
            "secret": true,
            "description": "The access token"
        },
        " accessTokenSecret":
        {
            "kind": "property",
            "displayName": "Access Token Secret",
            "group": "security",
            "label": "security",
            "required": false,
            "type": "string",
            "javaType": "java.lang.String",
            "deprecated": false,
            "secret": true,
            "description": "The access token secret"
        },
        " consumerKey":
        {
            "kind": "property",
            "displayName": "Consumer Key",
            "group": "security",
            "label": "security",
            "required": false,
            "type": "string",
            "javaType": "java.lang.String",
            "deprecated": false,
            "secret": true,
            "description": "The consumer key"
        },
        " consumerSecret":
        {
            "kind": "property",
            "displayName": "Consumer Secret",
            "group": "security",
            "label": "security",
            "required": false,
            "type": "string",
            "javaType": "java.lang.String",
            "deprecated": false,
            "secret": true,
            "description": "The consumer secret"
        }
    },
    "description": "Twitter Connector",
    "actions":
    [
        {
            "properties":
            {
            },
            "description": "Search for tweets that mention you",
            "camelConnectorGAV": "com.redhat.ipaas:twitter-mention-connector:0.3.3",
            "camelConnectorPrefix": "twitter-mention",
            "inputDataShape":
            {
                "dataType": "none"
            },
            "outputDataShape":
            {
                "dataType": "java:twitter4j.Status"
            },
            "id": "org.foo:twitter-mention-connector:latest",
            "name": "Mention"
        },
        {
            "properties":
            {
            },
            "description": "Search tweets based one or more keywords",
            "camelConnectorGAV": "com.redhat.ipaas:twitter-search-connector:0.3.3",
            "camelConnectorPrefix": "twitter-search",
            "id": "org.foo:twitter-search-connector:latest",
            "name": "Search"
        },
        {
            "properties":
            {
            },
            "description": "Creates a new tweet",
            "camelConnectorGAV": "com.redhat.ipaas:twitter-tweet-connector:0.3.3",
            "camelConnectorPrefix": "twitter-tweet",
            "id": "org.foo:twitter-tweet-connector:latest",
            "name": "Send a Tweet"
        },
        {
            "properties":
            {
            },
            "description": "Direct message a specific user",
            "camelConnectorGAV": "com.redhat.ipaas:twitter-directmessage-connector:0.3.3",
            "camelConnectorPrefix": "twitter-directmessage",
            "id": "org.foo:twitter-directmessage-connector:latest",
            "name": "Send a Direct Message"
        },
        {
            "properties":
            {
            },
            "description": "Retrieve tweets from my timeline",
            "camelConnectorGAV": "com.redhat.ipaas:twitter-mytimeline-connector:0.3.3",
            "camelConnectorPrefix": "twitter-mytimeline",
            "id": "org.foo:twitter-mytimeline-connector:latest",
            "name": "Get My Timeline"
        },
        {
            "properties":
            {
            },
            "description": "Retrieve tweets from another user's timeline",
            "camelConnectorGAV": "com.redhat.ipaas:twitter-usertimeline-connector:0.3.3",
            "camelConnectorPrefix": "twitter-usertimeline",
            "id": "org.foo:twitter-usertimeline-connector:latest",
            "name": "Get A Timeline"
        },
        {
            "properties":
            {
            },
            "description": "Retrieve tweets which retweet one of my tweets",
            "camelConnectorGAV": "com.redhat.ipaas:twitter-retweets-connector:0.3.3",
            "camelConnectorPrefix": "twitter-retweets",
            "id": "org.foo:twitter-retweets-connector:latest",
            "name": "Get Retweets"
        }
    ],
    "id": "twitter",
    "name": "Twitter"
}

Are you making a different request?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/redhat-ipaas/ipaas-rest/issues/264#issuecomment-290466810, or mute the thread https://github.com/notifications/unsubscribe-auth/AAVdrJjD7ztS7FbIdhnvUCiXoz6j4RXfks5rq9khgaJpZM4MuRWL .

KurtStam commented 7 years ago

@gashcrumb, no idea yet. on staging I can reproduce what you see for the connector list. However locally the connector list works fine as below.

As a workaround can you do a GET on /api/v1/connectors/twitter?

Weird when I use GET on /api/v1/connectors locally, I get 4 connectors, where twitter is the last one saying:

        {
            "icon": "fa-twitter",
            "properties":
            {
                " accessTokenSecret":
                {
                    "kind": "property",
                    "displayName": "Access Token Secret",
                    "group": "security",
                    "label": "security",
                    "required": false,
                    "type": "string",
                    "javaType": "java.lang.String",
                    "deprecated": false,
                    "secret": true,
                    "description": "The access token secret"
                },
                " consumerKey":
                {
                    "kind": "property",
                    "displayName": "Consumer Key",
                    "group": "security",
                    "label": "security",
                    "required": false,
                    "type": "string",
                    "javaType": "java.lang.String",
                    "deprecated": false,
                    "secret": true,
                    "description": "The consumer key"
                },
                " consumerSecret":
                {
                    "kind": "property",
                    "displayName": "Consumer Secret",
                    "group": "security",
                    "label": "security",
                    "required": false,
                    "type": "string",
                    "javaType": "java.lang.String",
                    "deprecated": false,
                    "secret": true,
                    "description": "The consumer secret"
                },
                "accessToken":
                {
                    "kind": "property",
                    "displayName": "Access Token",
                    "group": "security",
                    "label": "security",
                    "required": false,
                    "type": "string",
                    "javaType": "java.lang.String",
                    "deprecated": false,
                    "secret": true,
                    "description": "The access token"
                }
            },
            "description": "Twitter Connector",
            "actions":
            [
                {
                    "properties":
                    {
                    },
                    "description": "Search for tweets that mention you",
                    "camelConnectorGAV": "com.redhat.ipaas:twitter-mention-connector:0.3.3",
                    "camelConnectorPrefix": "twitter-mention",
                    "inputDataShape":
                    {
                        "dataType": "none"
                    },
                    "outputDataShape":
                    {
                        "dataType": "java:twitter4j.Status"
                    },
                    "id": "org.foo:twitter-mention-connector:latest",
                    "name": "Mention"
                },
                {
                    "properties":
                    {
                    },
                    "description": "Search tweets based one or more keywords",
                    "camelConnectorGAV": "com.redhat.ipaas:twitter-search-connector:0.3.3",
                    "camelConnectorPrefix": "twitter-search",
                    "id": "org.foo:twitter-search-connector:latest",
                    "name": "Search"
                },
                {
                    "properties":
                    {
                    },
                    "description": "Creates a new tweet",
                    "camelConnectorGAV": "com.redhat.ipaas:twitter-tweet-connector:0.3.3",
                    "camelConnectorPrefix": "twitter-tweet",
                    "id": "org.foo:twitter-tweet-connector:latest",
                    "name": "Send a Tweet"
                },
                {
                    "properties":
                    {
                    },
                    "description": "Direct message a specific user",
                    "camelConnectorGAV": "com.redhat.ipaas:twitter-directmessage-connector:0.3.3",
                    "camelConnectorPrefix": "twitter-directmessage",
                    "id": "org.foo:twitter-directmessage-connector:latest",
                    "name": "Send a Direct Message"
                },
                {
                    "properties":
                    {
                    },
                    "description": "Retrieve tweets from my timeline",
                    "camelConnectorGAV": "com.redhat.ipaas:twitter-mytimeline-connector:0.3.3",
                    "camelConnectorPrefix": "twitter-mytimeline",
                    "id": "org.foo:twitter-mytimeline-connector:latest",
                    "name": "Get My Timeline"
                },
                {
                    "properties":
                    {
                    },
                    "description": "Retrieve tweets from another user's timeline",
                    "camelConnectorGAV": "com.redhat.ipaas:twitter-usertimeline-connector:0.3.3",
                    "camelConnectorPrefix": "twitter-usertimeline",
                    "id": "org.foo:twitter-usertimeline-connector:latest",
                    "name": "Get A Timeline"
                },
                {
                    "properties":
                    {
                    },
                    "description": "Retrieve tweets which retweet one of my tweets",
                    "camelConnectorGAV": "com.redhat.ipaas:twitter-retweets-connector:0.3.3",
                    "camelConnectorPrefix": "twitter-retweets",
                    "id": "org.foo:twitter-retweets-connector:latest",
                    "name": "Get Retweets"
                }
            ],
            "id": "twitter",
            "name": "Twitter"
        }
    ],
    "totalCount": 4
}
jludvice commented 7 years ago

Hello, I see this issue on ipaas-qe currently. Partial of connections raw data (response on https://ipaas-qe.b6ff.rh-idev.openshiftapps.com/api/v1/connectors):

  {
      "icon": "fa-twitter",
      "properties": {
        "accessToken": {
          "type": "string"
        },
        "accessTokenSecret": {
          "kind": "property",
          "displayName": "Access Token Secret",
          "group": "security",
          "label": "security",
          "required": false,
          "type": "string",
          "javaType": "java.lang.String",
          "deprecated": false,
          "secret": true,
          "description": "The access token secret"
        },
        "consumerKey": {
          "kind": "property",
          "displayName": "Consumer Key",
          "group": "security",
          "label": "security",
          "required": false,
          "type": "string",
          "javaType": "java.lang.String",
          "deprecated": false,
          "secret": true,
          "description": "The consumer key"
        },

https://ipaas-qe.b6ff.rh-idev.openshiftapps.com/connections/create/connection-basics

rhuss commented 7 years ago

Problem is buried deep in jsondb and has its origin in the way how posgres does sorting which seem to ignore / for sorting even when lc_collate is set to en_US.utf8:

select path,value,kind from jsondb where path LIKE '/connectors/:twitter/properties/%' order by path

/connectors/:twitter/properties/accessToken/deprecated/        | false                   |   10
 /connectors/:twitter/properties/accessToken/description/       | The access token        |    6
 /connectors/:twitter/properties/accessToken/displayName/       | Access Token            |    6
 /connectors/:twitter/properties/accessToken/secret/            | true                    |    9
 /connectors/:twitter/properties/accessTokenSecret/deprecated/  | false        
...
 /connectors/:twitter/properties/accessTokenSecret/type/        | string                  |    6
 /connectors/:twitter/properties/accessToken/type/              | string                  |    6
....

Should be fixed with #289 (although I would love to have solution which would work out of the box by setting up the DB properly)

rhuss commented 7 years ago

Fixed now and live on staging.

jludvice commented 7 years ago

Confirm it's working properly on our ipaas-qe instance. Thanks @rhuss :)