Giter Site home page Giter Site logo

microsoft / powerplatformconnectors Goto Github PK

View Code? Open in Web Editor NEW
895.0 55.0 1.2K 24.65 MB

This is a repository for Microsoft Power Automate, Power Apps, and Azure Logic Apps connectors

Home Page: https://aka.ms/connectors

License: MIT License

Python 7.49% Shell 0.02% C# 92.49%
microsoft connector power-platform logicapps powerapps powerautomate hacktoberfest

powerplatformconnectors's Introduction

Microsoft Power Platform Connectors

Welcome to the Microsoft Power Platform Connectors open source repository. This repository contains custom connectors, certified connectors, and related tools to facilitate connector development for Azure Logic Apps, Microsoft Power Apps, and Microsoft Power Automate.

Custom Connectors

The custom-connectors folder contains fully functional connector samples which can be deployed to the Power Platform for extension and use. If you are looking to publish a connector to the Power Platform, please explore Certified Connectors and Independent Publisher Connectors.

Certified Connectors

The certified-connectors folder contains certified connectors which are built by partners who own the end service of their connector. These connectors are deployed and available out-of-box within the Power Platform for use. One requirement of our connector certification program is that new certified connectors be open sourced for community contributions. The certified-connectors folder is managed by the Microsoft Connector Certification Team to ensure that within the master branch, the connector version is identical to that deployed in the Power Platform. The dev branch is maintained by the connector owner and the Microsoft Connector Certification Team to allow community development of the connector prior to certification and deployment of a version.

Independent Publisher Connectors

The independent-publisher-connectors folder contains connectors that are submitted by publishers (MVPs, developers, and companies) that do not own the underlying service behind their connector. These connectors are deployed and available out-of-box within the Power Platform as premium connectors. Anyone can submit a new connector to this folder, add functionality to connectors in this folder, and resolve issues related to the connectors in this folder. The folder is managed by the Independent Publisher Connector Community, which includes Independent Publishers and Project Coordinators. The master branch is maintained by the Microsoft Connector Certification Team, who ensures that the connector version is identical to that deployed in the Power Platform. The dev branch is maintained by the connector maintainer(s) and the Microsoft Connector Certification Team to allow community development of the connector prior to certification and deployment of a version. Click here to view the Independent Publisher Connector Manifesto.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA), which declares that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

Files to Include

Please submit the following files: An Open API 2.0 swagger definition, an API properties file, and a README.md.

API Definition (Swagger) File

The API definition, also known as the swagger, describes the API for the custom connector using the OpenAPI specification.

For further details, see the apiDefinition.swagger.json JSON schema.

API Properties File

The API properties file contains some properties for the custom connector. These properties are not part of the API definition. It contains information such as the brand color, authentication information, etc. A typical API properties file looks like the following:

{
  "properties": {
    "capabilities": [],
    "connectionParameters": {
      "api_key": {
        "type": "securestring",
        "uiDefinition": {
          "constraints": {
            "clearText": false,
            "required": "true",
            "tabIndex": 2
          },
          "description": "The KEY for this API",
          "displayName": "KEY",
          "tooltip": "Provide your KEY"
        }
      }
    },
    "iconBrandColor": "#007EE6",
    "policyTemplateInstances": [
      {
        "title": "MyPolicy",
        "templateId": "setqueryparameter",
        "parameters": {
            "x-ms-apimTemplateParameter.name": "queryParameterName",
            "x-ms-apimTemplateParameter.value": "queryParameterValue",
            "x-ms-apimTemplateParameter.existsAction": "override"
        }
      }
    ]    
  }
}

More information on each of the properties are given below:

  • properties: The container for the information.

  • connectionParameters: Defines the connection parameter for the service.

  • iconBrandColor: The icon brand color in HTML hex code for the custom connector. Independent Publisher connectors must set the color to "#da3b01".

  • capabilities: Describes the capabilities for the connector, e.g. cloud only, on-prem gateway etc.

  • policyTemplateInstances: An optional list of policy template instances and values used in the custom connector.

For further details, see the apiProperties.json JSON schema.

README.md

README.md file for your connector includes a description for your connector, any prerequisite a developer or contributor may need to build your connector. It includes instructions on how to use your connector and api, how to get credentials, supported operations, known issues and limitations, etc. This file is meant to be a standalone guide for deploying and using your connector by other users and developers. A good example is the Azure Key Vault custom connector. A readme.md template for Certified Connectors and Independent Publisher Connectors is also included for your reference. If you are submitting an Independent Publisher connector that requires OAuth, please make sure to explain how to create the OAuth app. The Microsoft Certification Team will use those instructions to create the app, so please make sure they are detailed and accurate.

Creating a Fork

To contribute to this open source repository, start by creating a fork on this repository. To do so, select the "fork" button in the upper right corner, and create your own copy of the repository. Next, sync your fork with the remote repository and clone your forked repository to your local machine.

git clone https://github.com/YOUR-USERNAME/PowerPlatformConnectors.git

Check your remote URL.

git remote -v

> origin  https://github.com/YOUR_USERNAME/PowerPlatformConnectors.git (fetch)
> origin  https://github.com/YOUR_USERNAME/PowerPlatformConnectors.git (push)

Add an upstream repository for your clone.

git remote add upstream https://github.com/microsoft/PowerPlatformConnectors.git

Verify the upstream links.

git remote -v

> origin    https://github.com/YOUR_USERNAME/PowerPlatformConnectors.git (fetch)
> origin    https://github.com/YOUR_USERNAME/PowerPlatformConnectors.git (push)
> upstream  https://github.com/microsoft/PowerPlatformConnectors.git (fetch)
> upstream  https://github.com/microsoft/PowerPlatformConnectors.git (push)

To keep your fork up to date with this repository's updates, run these commands:

git fetch upstream

git checkout master

git merge upstream/master

You are now ready to develop your connector in your own branch.

Submitting to the Open Source Repository

Contributions to the open source repository are made through pull requests. Prior to submitting a pull request, ensure that 1) you have thoroughly tested the connector 2) you have provided response schemas unless the responses are dynamic, and 3) that your pull request does not contain any sensitive or specific information, for example client ids or client secrets. Any sensitive values can be replaced with fake or dummy values for the purposes of submission as long as it is clearly indicated. Also, ensure that the readme.md of the connector is updated with the latest information, or created for new connector submissions. An example of a clear, structured, readme.md can be found for the Azure Key Vault connector. A readme.md template for Certified Connectors and Independent Publisher Connectors is also included for your reference. Put the readme.md in the same directory as the other connector files. Add tags indicating which connector type you are submitting. Connector type name should match the folder name you are submitting to: custom-connector, certified-connector, or independent-publisher-connector.

Certified Connectors

For new connectors which will be submitted for certification, create a directory under the certified-connectors directory, place the connector files in the sub-folder, and submit a pull request to the dev branch. Ensure that a clear, structured, readme.md is included.

Add a tag by selecting the labels option to "certified-connector"

Updates to certified connectors must first be made through a pull request to the dev branch for review by the connector owner.

Once a pull request has been merged to the dev branch, the connector owner can submit the connector for certification through the Connector certification tab in ISV Studio. Once certified, the Microsoft Certification team will handle merging the updates from dev to master.

Updates to an existing custom connector can be made through a simple pull request to the dev branch to update the custom connector files.

Independent Publisher Connectors

Follow the same instructions as above on submitting for certification, create a directory under the "independent-publisher-connectors" directory and place the connector files in the sub-folder. The "iconBrandColor": in the API properties file must be set to "#da3b01". Set your pull request title to "Connector Name (Independent Publisher)." Paste in screenshots from the Test operations section and 3 unique operations (actions/triggers) working within a Flow. This can be in one flow or part of multiple flows. For each one of those flows, I have pasted in screenshots of the Flow succeeding. Add a tag by selecting the labels option to "independent-publisher-connector." If the connector uses OAuth, I have provided detailed steps on how to create an app in the readme.md.

Custom Connectors

Follow the same instructions on submitting for certification, create a directory under the custom-connectors directory and place the connector files in the sub-folder. Add a tag by selecting the labels option to "custom-connector".

Tooling and Validation

CLA

When a pull request is submitted, a CLA-bot will automatically determine whether you need to provide a CLA and annotate the PR appropriately. Simply follow the instructions provided by the bot to ensure your pull request can be properly reviewed. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Swagger Validation

A submitted pull request will also be validated against our Swagger Validator tool, which checks the connector files to ensure it is a proper Swagger file and adheres to our connector requirements and guidelines. Any errors or warnings will be added to the PR for both the submitter and the reviewer to understand. We do not accept pull requests with outstanding unresolved Swagger Validator issues.

Breaking Change Detector

Another validation which runs on a submitted pull request is the breaking changes validator. This is to catch any inadvertent, non-backwards-compatible (i.e. breaking) changes which may break a current user experience, for example, deleting a published operation. The Breaking Change Detector compares the previous version of the Swagger with the new submission and raises awareness of any breaking change. The submitter and reviewer must both acknowledge any breaking changes submitted and ensure that no end users are inadvertently negatively affected.

Legal Notices

Microsoft and any contributors grant you a license to the Microsoft documentation and other content in this repository under the Creative Commons Attribution 4.0 International Public License, see the LICENSE file, and grant you a license to any code in the repository under the MIT License, see the LICENSE-CODE file.

Microsoft, Windows, Microsoft Azure and/or other Microsoft products and services referenced in the documentation may be either trademarks or registered trademarks of Microsoft in the United States and/or other countries. The licenses for this project do not grant you rights to use any Microsoft names, logos, or trademarks. Microsoft's general trademark guidelines can be found at http://go.microsoft.com/fwlink/?LinkID=254653.

Privacy information can be found at https://privacy.microsoft.com/en-us/

Microsoft and any contributors reserve all others rights, whether under their respective copyrights, patents, or trademarks, whether by implication, estoppel or otherwise.

powerplatformconnectors's People

Contributors

amancdk avatar andvra avatar blackbaud-benlambert avatar cloudmersive avatar depfeife-msft avatar developmentll avatar encodian avatar fordosa90 avatar gijeyaku avatar harshitav-docusign avatar joem-msft avatar laskewitz avatar lukemcgovern-ul avatar mamurshe avatar marc-on-github avatar miguelverweijsogeti avatar natalie-pienkowska avatar paulculmsee avatar rflipper avatar ridlees avatar rjimpx avatar rkushvaha avatar sankumrav avatar simonbondyultima avatar sriharip-docusign avatar sriyen-msft avatar surjyams avatar timhanewich avatar troystaylor avatar varunynoox avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

powerplatformconnectors's Issues

When bundling custom connector image with solution, the image is replaced with the default one

When the iconblob is set to a valid PNG file, the default custom connector icon is still used.

The image is bundled in the solution ZIP file and customizations.xml contain the XML below which has correct paths as well:

<?xml version="1.0" encoding="utf-8"?>
<Connector xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <connectorid>59918c08-cc28-44b4-bf4f-edb5365517fd</connectorid>
  <description></description>
  <displayname>TALXIS_Connectors_XXXX</displayname>
  <iconbrandcolor>#007ee5</iconbrandcolor>
  <name>talxis_connectorsxxxx</name>
  <connectortype>1</connectortype>
  <openapidefinition>/Connector/talxis_xxxx_openapidefinition.json</openapidefinition>
  <connectionparameters>/Connector/talxis_xxxx_connectionparameters.json</connectionparameters>
  <policytemplateinstances>/Connector/talxis_xxxx_policytemplateinstances.json</policytemplateinstances>
  <iconblob>/Connector/talxis_xxxx_iconblob.png</iconblob>
</Connector>

400 Client Error: Missing Object ID

Describe the bug
Following Microsoft/PowerPlatformConnectors/AzureKeyVault Recipe

Created new AppRegistration as per step-by-step guide in docs.microsoft.com referenced on the github article, added the permissions
Downloaded the two JSON files, the api definitions and the api properties, modified the data inside to match the clicks I made on my side.
As per the recipe I run this command to create:

paconn create --api-def apiDefinition.swagger.json --api-prop apiProperties.json --secret "Foo********Bar"

and I get this error.
Please select an environment:
[1] Default Environment
Environment selected: Default Environment
{
"error": {
"code": "MissingObjectId",
"message": "The provided object identifier was null or missing."
}
}
400 Client Error: Bad Request for url: https://api.powerapps.com/providers/Microsoft.PowerApps/objectIds/validateApiSwagger?api-version=2016-11-01

The same error happens when I try and validate with the command below
paconn validate --api-def apiDefinition.swagger.json

Line 3 of teh apidefinition.swagger.json file looked suspicious considering i'm getting an object message.

{
  "basePath": "/",
  "consumes": [],

&& to triple check I pasted the file in an online json formatter and it confirmed it was a valid format.. so it's not a typo...
I read over the docs to make sure I didn't miss a click in portal.azure; and my user eyes say followed each step and started over a few times.
Frustrating to be hung up on the equivalent to Hello World -> your help and time is greatly appreciated!!!!

Cheers,
~C

Issue in documentation of Planner Connector

Hi Team,

We have followed Document and now able to building the connector and found where the issue is present .

It was mentioned in the above Document which was incorrect,

For API permissions, among other required permissions under "Microsoft Graph", please make sure "User.Read" is added. "User.Read" permission is required in order to login the current user and retrieve relevant information.

Solution(Document need to be updated)

We need to have any one of Group.Read.All, Group.ReadWrite.All permission and grant permission for APP to use planner as per MS Document

paconn does not have logout

Is your feature request related to a problem? Please describe.
If you login to paconn with account A and then want to login to paconn with account B there is actually no way to do this. Running paconn login again tells you you are already logged in. Running paconn logout does not exist as a command

Describe the solution you'd like
Add paconn logout or allow paconn login to be run while you are already logged in

Persist login with token or similar

I'm asked to login very frequently, which disrupts the development flow of the custom connector. Is it possible to specify something like an OAuth token so that I am persistently logged in?

This would also enable CI/CD of connectors.

Schema Validation Error

When run check for validation using, paconn validate --api-def [Location of apiDefinition.swagger.json] command, schema validation errors are coming even though the file is in working condition.

The PR is here

paconn validate command gets service error when swagger contains invalid $ref values

Describe the bug
When a swagger file (apiDefinition.swagger.json) contains invalid $ref values, they should be reported as errors by the paconn validate command.

To Reproduce

  1. cd into the following folder: certified-connectors\Pushcut
  2. run: paconn validate -d apiDefinition.swagger.json
  3. Note, the command executes and displays a couple warnings. This is the success case.
  4. Open the file: apiDefinition.swagger.json
  5. Modify the first "$ref" property by making it invalid:
    e.g. "$ref": "#/definitions/NotificationZZZZ"
  6. run: paconn validate -d apiDefinition.swagger.json

The last command reports a service error response like:

{
  "error": {
    "code": "InternalServerError",
    "message": "Encountered internal server error. The tracking Id is '61e92b1e-25b0-474d-8aa2-5be81dc9ea7f'."
  }
}
500 Server Error: Internal Server Error for url: https://api.powerapps.com/providers/Microsoft.PowerApps/objectIds/adce0039-9545-4253-ae21-0cb17e131cd8/validateApiSwagger?api-version=2016-11-01&enableConnectorCertificationRules=true

Expected behavior
Invalid $ref values should result in this command reporting them as errors.
Preferably, reporting multiple ref errors if the file contains them.

git push: refusing to allow an OAuth App to create or update workflow `.github/workflows/validation.yml` without `workflow` scope

Describe the bug
When I try to push the latest changes from this repository to my fork I receive output as follows:
Total 0 (delta 0), reused 0 (delta 0)
To https://github.com/IvanBil/PowerPlatformConnectors
! [remote rejected] master -> master (refusing to allow an OAuth App to create or update workflow .github/workflows/validation.yml without workflow scope)
error: failed to push some refs to 'https://github.com/IvanBil/PowerPlatformConnectors'

To Reproduce

git fetch upstream

git checkout master

git merge upstream/master

git push

Expected behavior

The push completes successfully like it was a few months ago.

Environment summary
Powershell with Git for Windows, Windows 10 Professional

Bundling Custom Connectors with Solutions and apiProperties.json

We want to ship all our connectors in solutions, since it appears to be the right approach to us (versioning, deployments etc.). We authenticate our connectors with Azure AD. In order for the connector to work correctly, we need to provide both Client ID and Client Secret. Client ID is a public information, and it's fine to have it inside a solution, but with Client Secret, it's a bit tricky. Generally, I don't want it bundled in the solution, but in order for import and connector to work post import, I need to include the ClientSecret which paconn does behind the scenes on import.

Since Azure AD supports certificate based authentication, wouldn't there be a way to enable a certificate based authentication where certificate is held only by MS and I set the public key as trusted to my app? It would be much more secure and would prevent shipping secret in the solution.

I noticed that MS first party connectors have something like dynamicscrmonlinecertificate:
image
or office365usercertificate:
image

I really would prefer to use this sort of authentication. Isn't there some sort of generic certificate and provider which can be used?

[paconn-cli] Cannot import name 'BlockBlobService' from 'azure.storage.blob'

Description of Feature or Work Requested
When calling the 'update' command with a fresh install of the paconn tool, the following error occurs:

Cannot import name 'BlockBlobService' from 'azure.storage.blob'

It turns out the latest version of the azure.storage.blob package (v12.1.0) has breaking change compared to the previous version (v2.1.0). And it doesn't have the BlockBlobService anymore.

[paconn] Add support for logout

Problem:
Sometimes we use a different accounts to deploy a connector across different environments (a PROD/TEST environment vs a community environment). The paconn utility, once logged in, cannot be used to target the other environment. The only option seems to wait out until the token expires - which is extremely painful.

Describe the solution you'd like
Add a paconn logout command.

Describe alternatives you've considered
Another window/session.

Facebook connector - 404

Hi,

I try to deploy the facebook sample custom connector with no success.

  • I registered a facebook app, with product "Facebook login" and I marked it as "native app".
  • On the apiProperty.json file I updated the clientID.
  • with the paconn I registered the connector on my tenant using the commands
    paconn login
    paconn create -s [Path to settings.json] --secret [The OAuth2 client secret for the connector]

No error shows untill this point, but accessing the custom connector I the 404 page with this message
"Error: Failed to retrieve api with http status code 'ApiResourceNotFound' and error message 'Could not find api ..."

Any suggestions will be appreciated
Thanks

[paconn] Paconn Update Throws Error

Describe the bug
Recently (in the last 3 days) i am getting a weird error when trying to update the connectors via paconn-cli. Issue exists on both Mac OS and Linux Platform

Expecting value: line 1 column 1 (char 0)
Traceback (most recent call last):
  File "/projects/.venv/lib/python3.6/site-packages/knack/cli.py", line 206, in invoke
    cmd_result = self.invocation.execute(args)
  File "/projects/.venv/lib/python3.6/site-packages/knack/invocation.py", line 188, in execute
    cmd_result = parsed_args.func(params)

  File "/projects/freelancing/azure-app/azure-fn-msflow-agent/plangrid-agent/swagger/fp/shared_plangrid-20-5fa1c41dcf6720de46-5f986c0f1bdfc46983/.venv/lib/python3.6/site-packages/paconn/apimanager/apimanager.py", line 115, in request
    response_content = json.loads(response.content)
  File "/usr/lib/python3.6/json/__init__.py", line 354, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.6/json/decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.6/json/decoder.py", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

To Reproduce
Download any Connector using Paconn download and just try to update back using paconn update -s settings.json

Expected behavior
A clear and concise description of what you expected to happen.

Environment summary
Installed using pip install

On Linux
paconn --version
0.0.13

Python (Linux) 3.6.9 (default, Apr 18 2020, 01:56:04)
[GCC 8.4.0]

On Mac
0.0.13

Python (Darwin) 3.7.7 (default, Mar 21 2020, 14:41:45)
[Clang 9.0.0 (clang-900.0.39.2)]

Additional context

Swagger for Facebook Connector Has Errors

Describe the bug
Unable to create a power automate app with power platform Customer facebook connection.

To Reproduce

  1. Go to power automate.
  2. Go to Data--> Custom connections tab.
  3. Click on new custom connectors icon.
  4. Click on Import an OpenAPI file.
  5. Select apiDefinition.swagger.json file within "..\Custom Connection\PowerPlatformConnectors-master\custom-connectors\Facebook".
  6. Put client id and client secret.
  7. Click on create connector.

Expected behavior
Specified swagger has the following errors: 'Definition is not valid. Error: 'Error : paths/~1{pageId}~1feed/get/parameters/0/x-ms-dynamic-values/parameters/Accept : The parameter could not be found in operation 'GetMyPages' in the swagger document. ## Error : paths/~1{pageId}~1feed/post/parameters/0/x-ms-dynamic-values/parameters/Accept : The parameter could not be found in operation 'GetMyPages' in the swagger document. '

image

"On all new alerts" trigger fires continuously

Describe the bug
I created a very simple flow with the "On all new alerts" trigger. Unfortunately, the trigger fires every 2 minutes and outputs the same 20 alerts.

To Reproduce
Create a flow with the "On all new alerts" trigger. Watch what happens.

Expected behavior
The flow should run only when there are new alerts, and it should never run on the same alert more than once.

Environment summary
Microsoft Flow

Additional context
Screenshot of flow:

image

No token to access

This issue occurs when running the flow after using FacebookCustomConnector.

The error message.
{"error":{"message":"(#200) If posting to a group, requires app being installed in the group, and \\n either publish_to_groups permission with user token, or both manage_pages \\n and publish_pages permission with page token; If posting to a page, \\n requires both manage_pages and publish_pages as an admin with \\n sufficient administrative permission","type":"OAuthException","code":200,"fbtrace_id":"AzXqcby3Z7R72M88cOfZ7ED"}}

I found that there's no Get my Access Token option when using the connector and it should be the root cause.

Can you suggest how I can modify the json file to make it work?

Array name gets put before field name/renaming arrays in custom connector

Hello,
I have been creating a custom connector and I came upon an issue. When I define an array, custom connector automatically names fields after that array, which creates mess and is basically unusable/unreadable.
Example of OpenApi definition:
image
And how it looks in the custom connector:
image
As you can see, name of the array (People) is put before every single field. And when another array is defined (positions), it get put there too, making even more mess.
Any suggestion on how to fix this?

Localization of Custom Connectors

We would like to distribute a custom connector in a solution with multiple languages (primarily labels, descriptions etc.) - how can we include translations with the Swagger definition?

Reference #274

[paconn download] apiProperties.json should not emit internal properties

Describe the bug
When downloading the connection parameters for a connector, certain properties of the oAuthSettings object should not be saved, as these are output properties, not input properties.

To Reproduce
paconn download for any connector that uses oauthsettings tokens.

Expected behavior
the following properties under the oAuthSettings object should not be saved:

  • redirectUrl
  • properties - This is an object which has only internal, client values. e.g. '/properties/IsFirstParty'

Rename paconn settings.json file to something less generic

Is your feature request related to a problem? Please describe.
settings.json is too generic a name for tooling. e.g. /.vscode/settings.json. This file is owned by vscode, but because it's in a subfolder it's unambiguous.

Furthermore, writing VS Code tooling to this file would be simpler if it had a unique name.

Also, we can add a more specific filename to our .gitignore to prevent this file (a user-specific) file from accidentally being added to the repo.

Describe the solution you'd like
how about paconn-settings.json?
all lowercase and usage of '-' allows for easy normalization of the filename.

Client Certificate authentication in Custom Connector

We need to connect to a custom API through a proxy server thats need a client certificate for authentication. Also, the custom API it self needs Oauth 2 for handling the authentication.

So we have to types of authentication for 1 HTTP request.

Custom connectors do not support client certification at all and you are only able to choose 1 type of authentication.

Describe the solution you'd like
Maybe APIM Policy's for adding a client certificate? Like this: https://docs.microsoft.com/nl-nl/azure/api-management/api-management-authentication-policies#ClientCertificate

Describe alternatives you've considered
Normal HTTP request support client certificates, but then we need to manually do the oauth process which is not 100% secure.

Update readme.md with instructions for merging and submitting PR's

The instructions for submitting a connector to the repo terminate at getting the local dev environment configured. There are no steps provided for how to proceed beyond copying connector artifacts into a subdirectory. This is confusing for people who do not use Git on a regular basis. A generic statements such as "Updates to certified connectors must first be made through a pull request to the dev branch for review by the connector owner" does not provide enough information to complete the process.

Since final certification and deployment is dependent on this task, it is imperative that clear instructions be given on how to properly merge a dev branch and submit a PR to maximize the possibility of acceptance. As with the previous section on creating a fork, the certified connectors section should provide sample commands and sequential steps. There are too many ways to accomplish a task in Git to leave it at generic, open-ended statements.

Can we please add a Readme.md file for the samples?

The samples "CompaniesHouse" and "IdealPostcodes" looks interesting, but I dont know how to get started. Can we please add a ReadMe.md file with instructions?

Ideally the ReadMe will target both contributors and end users and will contain the following:
[1] A brief intro on the service/API we are connecting to - so that users understand what the connector is supposed to do. For contributors, the link to the API descriptions will be helpful.
[2] Any requirements to create the connector - like an OAUTH App registration, if required.
[3] A brief description of the functions/operations exposed by the connector.
[4] A brief description on how to use the connector - how to sign up, get keys, etc.

CSRF Token Validation Failed

Describe the bug
I am connecting to SAP Demo System using Power Automate and OData connector. I am able to fetch the products successfully but while adding product I am getting error : CSRF Token validation failed.
To Reproduce
Steps to reproduce the behavior.
Step 1: I am creating a flow manual start action (for testing purpose, using power apps action also gives same error).
Step 1 : Add ListProuctSet action
Step 3 : Add product set action with set cookies and headers like this : replace(outputs('List_product_sets')?['headers/Set-Cookie'],',',';')
Step 4: run flow
Expected behavior
It should add new product in SAP system

[paconn] simplify paconn create/update commands so filenames are assumed to be the expected folder layout filenames

Describe the bug
The names of these files should be assumed if not specified. The filenames already have defaults in the settings.py file. We shoudn't have to specify them on the cmd line or explicitly in the settings.json file. Instead, they should use the same default values.

While the repro steps describe one of the ways this behavior shows up, the ask here is to make it so that adherence to the folder structure and filenames results in simpler command execution.

To Reproduce

  1. cd into an existing connector's folder (e.g. certified-connectors\AzureAD)
  2. create a settings.json file with the following content:
{
  "connectorId": "myAzureAD"
}
  1. run the command paconn create -s settings.json
    a. When prompted, select an environment and hit enter.

Expected behavior
A custom connector should've been created successfully.

Actual Behavior
An error occurs stating: API Properties must be specified.

Swagger error using Facebook connector

Describe the bug
When using the Facebook connector, I get a swagger error.

To Reproduce
-Create a Facebook custom connector on Power Automate.
-Import the apiDefinition.Swagger.json
-Create the connector

Expected behavior
The connector is expected to be created successfully

Environment summary

Additional context
Error message:
_Specified swagger has the following errors: 'Error : paths/~1{pageId}~1feed/get/parameters/0/x-ms-dynamic-values/parameters/Accept : The parameter could not be found in operation 'GetMyPages' in the swagger document.

Error : paths/~1{pageId}~1feed/post/parameters/0/x-ms-dynamic-values/parameters/Accept : The parameter could not be found in operation 'GetMyPages' in the swagger document.__

Can't use 'paconn update'

Describe the bug
paconn update never succeeds for me. Running with a debug flag to show that the application spends minutes on this line urllib3.connectionpool : Starting new HTTPS connection (1): api.powerapps.com:443 before returning with error.

urllib3.connectionpool : Starting new HTTPS connection (1): api.powerapps.com:443
urllib3.connectionpool : https://api.powerapps.com:443 "PATCH /providers/Microsoft.PowerApps/apis/abc?api-version=2016-11-01&%24filter=environment%20eq%20%27Default-xyz%27 HTTP/1.1" 502 0
Expecting value: line 1 column 1 (char 0)
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/knack/cli.py", line 206, in invoke
    cmd_result = self.invocation.execute(args)
  File "/usr/local/lib/python3.7/site-packages/knack/invocation.py", line 188, in execute
    cmd_result = parsed_args.func(params)
  File "/usr/local/lib/python3.7/site-packages/knack/commands.py", line 131, in __call__
    return self.handler(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/knack/commands.py", line 238, in _command_handler
    result = op(client, **command_args) if client else op(**command_args)
  File "/usr/local/lib/python3.7/site-packages/paconn/commands/update.py", line 51, in update
    overwrite_settings=False)
  File "/usr/local/lib/python3.7/site-packages/paconn/operations/upsert.py", line 135, in upsert
    payload=property_definition)
  File "/usr/local/lib/python3.7/site-packages/paconn/apimanager/powerappsrp.py", line 71, in update_connector
    payload=payload)
  File "/usr/local/lib/python3.7/site-packages/paconn/apimanager/apimanager.py", line 115, in request
    response_content = json.loads(response.content)
  File "/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/__init__.py", line 348, in loads
    return _default_decoder.decode(s)
  File "/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

To Reproduce
I've download my settings with paconn download and then executed with paconn update --settings settings.json --debug
Expected behavior
I expect that the API definition is updated and without errors.

Environment summary

paconn --version
0.0.13

Python (Darwin) 3.7.7 (default, Mar 10 2020, 15:43:33)
[Clang 11.0.0 (clang-1100.0.33.17)]

Python location '/usr/local/opt/python/bin/python3.7'

macOS. paconn instaled using pip.

Microsoft MVP API

Describe the bug

I have a custom connector for Microsoft MVP API.
https://github.com/johnnliu/flow/blob/master/MVP%20Production.swagger.json

The API needs two pieces of authentication.

MSA and a per-user Ocp-Apim-Subscription-Key.

I'm not sure how to write a custom connector that has two authentication parts. Also, the API header is needed in every call.

Would love to pull it into this project, but there's an issue with it and I'm not sure how to write this swagger. Right now, people that used this had to take a copy and override line 35.

paconn tool does not have a way to create zip file, even though instructions say to do this

Describe the bug
The instructions in the connector certification portal say: "Please use the CLI Tool to create the zip file containing your connector artifacts. Documentation on this process can be found here."

However, this is not possible because paconn has no way of outputting a zip file

Expected behavior
Provide paconn package command that outputs a zip file. Right now paconn download makes a folder, but not a zip file. The website actually requires a zip file.

Add Canvas App Export Feature

I would really like the ability to export apps pragmatically and move then to different environments. I feel like most people, that are using PowerApps as fast deployed solutions, have a Dev Environment and a Prod Environment.

If you could export the app and then import the app in a new environment I feel like this would solve the problem.

You also could just add functionality to copy it to a different environment, but it might be easier/more flexible to just allow exporting and importing apps

Additional context
https://docs.microsoft.com/en-us/power-platform/admin/environment-and-tenant-migration

[paconn] Allow client credentials authentication

Use case
As a developer, I want to be able to run paconn from inside my DevOps pipelines. For that, I need to use an AAD Service Principal for authentication, allowing for paconn to run with no user interaction in a transient environment (e.g.: a short-lived Docker container).

Additional context
As of today, paconn only supports device authentication, which requires user interaction - subsequent operations won't prompt for login, but then it requires a persistent environment for caching the token. Support for client credentials authentication would allow running paconn with no user interaction, making it possible to use it in several DevOps solutions (e.g.: ADO, Github Actions, Jenkins, Bamboo and so on).

How it could work
By having an additional --client_secret flag on login command, we could switch from device authentication to client credentials authentication. In profile.py we could have an additional function, such as:

    def authenticate_client_credentials(self):
        """
        Do some stuff ...
        """
        mgmt_token = context.acquire_token_with_client_credentials(
            resource=self.resource,
            client_id=self.client_id,
            client_secret=self.client_secret)

        """
        Do some more stuff ...
        """

        return credentials.token

And, in auth.py:

        if profile.client_secret:
            credentials = profile.authenticate_client_credentials()
        else:
            credentials = profile.authenticate_device_code()

Logout does not work

Describe the bug
Logout does not work

To Reproduce
paconn logout

Expected behavior
logout from existing env

Environment summary
c:\Users\daemel\Downloads\Code\repos>paconn --version
0.0.13

Python (Windows) 3.8.2 (tags/v3.8.2:7b3ab59, Feb 25 2020, 23:03:10) [MSC v.1916 64 bit (AMD64)]

Python location 'c:\users*****l\appdata\local\programs\python\python38\python.exe'

Additional context
c:\Users\daemel\Downloads\Code\repos>paconn logout
usage: paconn [-h] [--verbose] [--debug] [--output {json,jsonc,table,tsv}] [--query JMESPATH]
{login,download,create,update,validate} ...
paconn: error: argument _command: invalid choice: 'logout' (choose from 'login', 'download', 'create', 'update', 'validate')

There is any way to login without the need to access a endpoint?

Description of Feature or Work Requested
There is a CLI tool, but to log in, we need to access an endpoint through a browser. No problem with that, it works, but this blocks things like continuous delivery where we expect to log in through the terminal in a CI environment.

There is any way to do that or if not, there is any plan to implement this feature?

Localization of custom connector

I didn't find any document about the localization for custom connector, but I do see that the certified connector is localized if I change the PowerAutomate page to a different language, how it happened? it's auto translated by Bing translator?

Support client credentials Oauth 2.0 flow

At the moment, it seems that only the accessCode flow is supported in the generic Oauth 2.0 identity provider. However, our APIs use the authorization code flow and client credentials flow. Which makes an integration with Microsoft Power Automate impossible for us unless we change our Oauth 2.0 implementation.

When I try to create a custom connector forcing the client credentials flow using the "application" as flow. It gets uploaded with the CLI but then when I try to make a connection with my connector, it fails saying it is missing an "authorizationUrl", which makes me think it falls back to accessCode all the time.

Custom connectors should ideally be allowed to chose at least the client credentials flow and not just the accessCode flow.

Normalize casing of policy template instances

Currently, policyTemplateInstances have different cases for different connectors.

In reality, the RPs are not case-sensitive on these ids. Yet normalizing on a casing would simplify schemas and checked in code.

To address this, we'd need to:

  • normalize existing instances in the repo
  • update paconn to do this normalization so it doesn't need to be done manually.

Originally posted by @mamurshe in https://github.com/microsoft/PowerPlatformConnectors/diffs

Validate function does not recognize allowable number formats such as int64

Describe the bug
If the api definition file contains definition with properties of type "number", with format "int64", the validation function throws the following error:

The type/format 'number/int64' is not recognized.

This is inconsistent with the OpenAPI 2.0 specification, which, in addition to an empty value, allows the following format values for type "number":

float
double
int32
int64

To Reproduce
Create a definition similar to the following:

"customDefinition" : {
"type" : "object",
"properties" : {
"prop1" : {
"type" : "number",
"format" : "int64",
"description" : "Property 1"
}
}

Run paconn validate --api-def apiDefinition.swagger.json

Command returns "definitions/customDefinition/properties/prop1/format: The type/format 'number/int64' is not recognized".

Expected behavior
The definition should pass validation.

Environment summary
Install Method: pip
CLI Version: 0.0.14 (Python 3.8.3)
OS: Mac OS 10.15.5

paconn validate (Bad Request for url)

Describe the bug
When attempting to validate a connector you get the below error

image

Navigating to the URL given in the error

https://api.powerapps.com/providers/Microsoft.PowerApps/objectIds/c03fcc17-7e4e-4a4a-bf0f-5f39e2844a83/validateApiSwagger?api-version=2016-11-01&enableConnectorCertificationRules=true

returns

{"message":"No HTTP resource was found that matches the request URI 'https://api.powerapps.com/providers/Microsoft.PowerApps/objectIds/c03fcc17-7e4e-4a4a-bf0f-5f39e2844a83/validateApiSwagger?api-version=2016-11-01&enableConnectorCertificationRules=true'."}

To Reproduce
paconn validate --api-def apiDefinition.swagger.json

Expected behavior
A clear and concise description of what you expected to happen.

Environment summary
paconn-cli version 0.0.10 running in Docker container on MacOS Mojave

docker run --rm -it -v $(pwd):/usr/app/paconn garryt/paconn-cli

Looks like you changed the folder structure, which broke links In Power Automate documentation

Describe the bug
Broken links in Power Automate docs due to folder changes in this repo.

To Reproduce
Click on links references this repo on this page - https://docs.microsoft.com/en-us/connectors/facebook/

Expected behavior
You may want to check with Docs team to figure out how impactful this is across all Power Platform docs.

Environment summary
Install Method (e.g. pip, interactive script, apt-get, Docker, MSI, edge build) / CLI version (paconn --version) / OS version / Shell Type (e.g. bash, cmd.exe, Bash on Windows)

Additional context
Add any other context about the problem here.

InvalidRequestContent: Could not find member 'stackOwner' on object of type 'ApiPropertiesDefinition'

Describe the bug
I cannot create a new connector based on any of the certified connectors in this repository, as it always reports back the following response:

{
  "error": {
    "code": "InvalidRequestContent",
    "message": "The request content was invalid and could not be deserialized: 'Could not find member 'stackOwner' on object of type 'ApiPropertiesDefinition'. Path 'properties.stackOwner', line 1, position 1161.'."
  }
}

To Reproduce
Go into certified-connectors/Connective eSignatures, and run:

paconn create

Expected behavior
New connector to be created in my environment.

Additional context
It works when I remove stackOwner property from the apiProperties.json file. That's annoying because I'd need to remember to add it back in to submit an update to the connector.

Connect with service principal

Is your feature request related to a problem? Please describe.
Custom connector should provide an option to connect with service principal credentials.

Describe the solution you'd like
Like other standard connectors provides option to connect with service principal credentials.
image
image

Describe alternatives you've considered
Already tried in swagger editor to change flow from accessCode to application. After Update connector action oauth2 flow is changed back to accessCode.

Sample yaml:

securityDefinitions:
  oauth2_auth:
    type: oauth2
    flow: application 
    tokenUrl: https://login.microsoftonline.com/common/oauth2/token

Additional context
Custom connector should provide connectivity without user context (aka service-to-service communication) and application permission (not delegated).

Buffer Connector stopped working - HTTP 403

Describe the bug
The Buffer connector is unable to read the profile json via API.

image

There might have been a breaking change between 16h and 17th of September on the Buffer API.

To Reproduce
Create a Buffer connector, authorize with your account and add the connector to a Flow.

Expected behavior
The list of configured profiles in Buffer would be listed and messages from Power Apps should be queued by Buffer.

Additional context
This Buffer Connector was created by Microsoft, as stated in the documentation (https://docs.microsoft.com/en-us/connectors/buffer/) but is not source controlled in this Repo!!!

Swagger Validator and paconn tool doesn't check for 'content_type' syntax

Describe the bug
Swagger Validator doesn't check for 'content_type' syntax in the swagger

To Reproduce
Below Swagger passed paconn tool and Swagger Validator
{
"in": "body",
"name": "body",
"required": true,
"schema": {
"default": {
"conten_type": "sdsd",
"encoding": "cp1251"
},
"properties": {
"conten_type": {
"description": "conten_type",
"title": "Content type",
"type": "string"
},
"encoding": {
"description": "encoding",
"enum": [
"cp1251",
"cp866",
"utf-8"
],
"title": "Encoding",
"type": "string"
}
},
"required": [
"conten_type",
"encoding"
],
"type": "object"
}
}

Expected behavior
The paconn and Swagger Validator should validate the content_type and its value. Please close the bug if this is a design of the tools.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.