Skip to content

Commit

Permalink
Merge branch 'main' into v-gandiddi/RemoveColon
Browse files Browse the repository at this point in the history
  • Loading branch information
tracyboehrer authored Jul 1, 2024
2 parents 6c488f6 + c20b27b commit 95ce3b6
Show file tree
Hide file tree
Showing 41 changed files with 235 additions and 84 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ For more information jump to a section below.

| Branch | Description | Build Status | Coverage Status | Code Style |
|----|---------------|--------------|-----------------|--|
| Main | 4.16.0 Builds | [![Build Status](https://fuselabs.visualstudio.com/SDK_v4/_apis/build/status/Python/Python-CI-PR-yaml?branchName=main)](https://fuselabs.visualstudio.com/SDK_v4/_build/latest?definitionId=771&branchName=main) | [![Coverage Status](https://coveralls.io/repos/github/microsoft/botbuilder-python/badge.svg?branch=HEAD)](https://coveralls.io/github/microsoft/botbuilder-python?branch=HEAD) | [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) |
| Main | 4.17.0 Builds | [![Build Status](https://fuselabs.visualstudio.com/SDK_v4/_apis/build/status/Python/Python-CI-PR-yaml?branchName=main)](https://fuselabs.visualstudio.com/SDK_v4/_build/latest?definitionId=771&branchName=main) | [![Coverage Status](https://coveralls.io/repos/github/microsoft/botbuilder-python/badge.svg?branch=HEAD)](https://coveralls.io/github/microsoft/botbuilder-python?branch=HEAD) | [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black) |

## Packages

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

__title__ = "botbuilder-adapters-slack"
__version__ = (
os.environ["packageVersion"] if "packageVersion" in os.environ else "4.16.0"
os.environ["packageVersion"] if "packageVersion" in os.environ else "4.17.0"
)
__uri__ = "https://www.github.com/Microsoft/botbuilder-python"
__author__ = "Microsoft"
Expand Down
2 changes: 1 addition & 1 deletion libraries/botbuilder-adapters-slack/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
aiohttp==3.9.5
pyslack
botbuilder-core==4.16.0
botbuilder-core==4.17.0
slackclient
6 changes: 3 additions & 3 deletions libraries/botbuilder-adapters-slack/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
from setuptools import setup

REQUIRES = [
"botbuilder-schema==4.16.0",
"botframework-connector==4.16.0",
"botbuilder-core==4.16.0",
"botbuilder-schema==4.17.0",
"botframework-connector==4.17.0",
"botbuilder-core==4.17.0",
"pyslack",
"slackclient",
]
Expand Down
2 changes: 1 addition & 1 deletion libraries/botbuilder-ai/botbuilder/ai/about.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

__title__ = "botbuilder-ai"
__version__ = (
os.environ["packageVersion"] if "packageVersion" in os.environ else "4.16.0"
os.environ["packageVersion"] if "packageVersion" in os.environ else "4.17.0"
)
__uri__ = "https://www.github.com/Microsoft/botbuilder-python"
__author__ = "Microsoft"
Expand Down
4 changes: 2 additions & 2 deletions libraries/botbuilder-ai/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
msrest== 0.7.*
botbuilder-schema==4.16.0
botbuilder-core==4.16.0
botbuilder-schema==4.17.0
botbuilder-core==4.17.0
requests==2.32.0
aiounittest==1.3.0
azure-cognitiveservices-language-luis==0.2.0
4 changes: 2 additions & 2 deletions libraries/botbuilder-ai/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

REQUIRES = [
"azure-cognitiveservices-language-luis==0.2.0",
"botbuilder-schema==4.16.0",
"botbuilder-core==4.16.0",
"botbuilder-schema==4.17.0",
"botbuilder-core==4.17.0",
"aiohttp==3.9.5",
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

__title__ = "botbuilder-applicationinsights"
__version__ = (
os.environ["packageVersion"] if "packageVersion" in os.environ else "4.16.0"
os.environ["packageVersion"] if "packageVersion" in os.environ else "4.17.0"
)
__uri__ = "https://www.github.com/Microsoft/botbuilder-python"
__author__ = "Microsoft"
Expand Down
2 changes: 1 addition & 1 deletion libraries/botbuilder-applicationinsights/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
msrest== 0.7.*
botbuilder-core==4.16.0
botbuilder-core==4.17.0
aiounittest==1.3.0
6 changes: 3 additions & 3 deletions libraries/botbuilder-applicationinsights/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

REQUIRES = [
"applicationinsights==0.11.9",
"botbuilder-schema==4.16.0",
"botframework-connector==4.16.0",
"botbuilder-core==4.16.0",
"botbuilder-schema==4.17.0",
"botframework-connector==4.17.0",
"botbuilder-core==4.17.0",
]
TESTS_REQUIRES = [
"aiounittest==1.3.0",
Expand Down
2 changes: 1 addition & 1 deletion libraries/botbuilder-azure/botbuilder/azure/about.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

__title__ = "botbuilder-azure"
__version__ = (
os.environ["packageVersion"] if "packageVersion" in os.environ else "4.16.0"
os.environ["packageVersion"] if "packageVersion" in os.environ else "4.17.0"
)
__uri__ = "https://www.github.com/Microsoft/botbuilder-python"
__author__ = "Microsoft"
Expand Down
4 changes: 2 additions & 2 deletions libraries/botbuilder-azure/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"azure-cosmos==3.2.0",
"azure-storage-blob==12.7.0",
"azure-storage-queue==12.4.0",
"botbuilder-schema==4.16.0",
"botframework-connector==4.16.0",
"botbuilder-schema==4.17.0",
"botframework-connector==4.17.0",
"jsonpickle>=1.2,<1.5",
]
TEST_REQUIRES = ["aiounittest==1.3.0"]
Expand Down
2 changes: 1 addition & 1 deletion libraries/botbuilder-core/botbuilder/core/about.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

__title__ = "botbuilder-core"
__version__ = (
os.environ["packageVersion"] if "packageVersion" in os.environ else "4.16.0"
os.environ["packageVersion"] if "packageVersion" in os.environ else "4.17.0"
)
__uri__ = "https://www.github.com/Microsoft/botbuilder-python"
__author__ = "Microsoft"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,9 @@ async def _authenticate(self, auth_header: str) -> ClaimsIdentity:
)
if not is_auth_disabled:
# No auth header. Auth is required. Request is not authorized.
raise PermissionError()
raise PermissionError(
"Authorization is required but has been disabled."
)

# In the scenario where Auth is disabled, we still want to have the
# IsAuthenticated flag set in the ClaimsIdentity. To do this requires
Expand Down
6 changes: 3 additions & 3 deletions libraries/botbuilder-core/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
msrest== 0.7.*
botframework-connector==4.16.0
botbuilder-schema==4.16.0
botframework-streaming==4.16.0
botframework-connector==4.17.0
botbuilder-schema==4.17.0
botframework-streaming==4.17.0
requests==2.32.0
PyJWT==2.4.0
cryptography==42.0.4
Expand Down
8 changes: 4 additions & 4 deletions libraries/botbuilder-core/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
import os
from setuptools import setup

VERSION = os.environ["packageVersion"] if "packageVersion" in os.environ else "4.16.0"
VERSION = os.environ["packageVersion"] if "packageVersion" in os.environ else "4.17.0"
REQUIRES = [
"botbuilder-schema==4.16.0",
"botframework-connector==4.16.0",
"botframework-streaming==4.16.0",
"botbuilder-schema==4.17.0",
"botframework-connector==4.17.0",
"botframework-streaming==4.17.0",
"jsonpickle>=1.2,<1.5",
]

Expand Down
2 changes: 1 addition & 1 deletion libraries/botbuilder-dialogs/botbuilder/dialogs/about.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

__title__ = "botbuilder-dialogs"
__version__ = (
os.environ["packageVersion"] if "packageVersion" in os.environ else "4.16.0"
os.environ["packageVersion"] if "packageVersion" in os.environ else "4.17.0"
)
__uri__ = "https://www.github.com/Microsoft/botbuilder-python"
__author__ = "Microsoft"
Expand Down
6 changes: 3 additions & 3 deletions libraries/botbuilder-dialogs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
msrest== 0.7.*
botframework-connector==4.16.0
botbuilder-schema==4.16.0
botbuilder-core==4.16.0
botframework-connector==4.17.0
botbuilder-schema==4.17.0
botbuilder-core==4.17.0
requests==2.32.0
PyJWT==2.4.0
cryptography==42.0.4
Expand Down
6 changes: 3 additions & 3 deletions libraries/botbuilder-dialogs/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
"recognizers-text>=1.0.2a1",
"recognizers-text-choice>=1.0.2a1",
"babel==2.9.1",
"botbuilder-schema==4.16.0",
"botframework-connector==4.16.0",
"botbuilder-core==4.16.0",
"botbuilder-schema==4.17.0",
"botframework-connector==4.17.0",
"botbuilder-core==4.17.0",
]

TEST_REQUIRES = ["aiounittest==1.3.0"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

__title__ = "botbuilder-integration-aiohttp"
__version__ = (
os.environ["packageVersion"] if "packageVersion" in os.environ else "4.16.0"
os.environ["packageVersion"] if "packageVersion" in os.environ else "4.17.0"
)
__uri__ = "https://www.github.com/Microsoft/botbuilder-python"
__author__ = "Microsoft"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ async def process(
return Response(status=201)
else:
raise HTTPMethodNotAllowed
except (HTTPUnauthorized, PermissionError) as _:
except PermissionError:
raise HTTPUnauthorized

async def _connect(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,23 @@
from logging import Logger
from typing import Any

from msrest.authentication import Authentication

from botframework.connector.auth import PasswordServiceClientCredentialFactory
from botframework.connector.auth import ManagedIdentityServiceClientCredentialsFactory
from botframework.connector.auth import ServiceClientCredentialsFactory


class ConfigurationServiceClientCredentialFactory(
PasswordServiceClientCredentialFactory
):
class ConfigurationServiceClientCredentialFactory(ServiceClientCredentialsFactory):
def __init__(self, configuration: Any, *, logger: Logger = None) -> None:
self._inner = None

app_type = (
configuration.APP_TYPE
if hasattr(configuration, "APP_TYPE")
else "MultiTenant"
)
).lower()

app_id = configuration.APP_ID if hasattr(configuration, "APP_ID") else None
app_password = (
configuration.APP_PASSWORD
Expand All @@ -24,10 +29,25 @@ def __init__(self, configuration: Any, *, logger: Logger = None) -> None:
)
app_tenantid = None

if app_type == "UserAssignedMsi":
raise Exception("UserAssignedMsi APP_TYPE is not supported")
if app_type == "userassignedmsi":
if not app_id:
raise Exception("Property 'APP_ID' is expected in configuration object")

app_tenantid = (
configuration.APP_TENANTID
if hasattr(configuration, "APP_TENANTID")
else None
)
if not app_tenantid:
raise Exception(
"Property 'APP_TENANTID' is expected in configuration object"
)

self._inner = ManagedIdentityServiceClientCredentialsFactory(
app_id, logger=logger
)

if app_type == "SingleTenant":
elif app_type == "singletenant":
app_tenantid = (
configuration.APP_TENANTID
if hasattr(configuration, "APP_TENANTID")
Expand All @@ -45,4 +65,36 @@ def __init__(self, configuration: Any, *, logger: Logger = None) -> None:
"Property 'APP_TENANTID' is expected in configuration object"
)

super().__init__(app_id, app_password, app_tenantid, logger=logger)
self._inner = PasswordServiceClientCredentialFactory(
app_id, app_password, app_tenantid, logger=logger
)

# Default to MultiTenant
else:
if not app_id:
raise Exception("Property 'APP_ID' is expected in configuration object")
if not app_password:
raise Exception(
"Property 'APP_PASSWORD' is expected in configuration object"
)

self._inner = PasswordServiceClientCredentialFactory(
app_id, app_password, None, logger=logger
)

async def is_valid_app_id(self, app_id: str) -> bool:
return await self._inner.is_valid_app_id(app_id)

async def is_authentication_disabled(self) -> bool:
return await self._inner.is_authentication_disabled()

async def create_credentials(
self,
app_id: str,
oauth_scope: str,
login_endpoint: str,
validate_authority: bool,
) -> Authentication:
return await self._inner.create_credentials(
app_id, oauth_scope, login_endpoint, validate_authority
)
4 changes: 2 additions & 2 deletions libraries/botbuilder-integration-aiohttp/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
msrest== 0.7.*
botframework-connector==4.16.0
botbuilder-schema==4.16.0
botframework-connector==4.17.0
botbuilder-schema==4.17.0
aiohttp==3.9.5
8 changes: 4 additions & 4 deletions libraries/botbuilder-integration-aiohttp/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
import os
from setuptools import setup

VERSION = os.environ["packageVersion"] if "packageVersion" in os.environ else "4.16.0"
VERSION = os.environ["packageVersion"] if "packageVersion" in os.environ else "4.17.0"
REQUIRES = [
"botbuilder-schema==4.16.0",
"botframework-connector==4.16.0",
"botbuilder-core==4.16.0",
"botbuilder-schema==4.17.0",
"botframework-connector==4.17.0",
"botbuilder-core==4.17.0",
"yarl>=1.8.1",
"aiohttp==3.9.5",
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

__title__ = "botbuilder-integration-applicationinsights-aiohttp"
__version__ = (
os.environ["packageVersion"] if "packageVersion" in os.environ else "4.16.0"
os.environ["packageVersion"] if "packageVersion" in os.environ else "4.17.0"
)
__uri__ = "https://www.github.com/Microsoft/botbuilder-python"
__author__ = "Microsoft"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
REQUIRES = [
"applicationinsights>=0.11.9",
"aiohttp==3.9.5",
"botbuilder-schema==4.16.0",
"botframework-connector==4.16.0",
"botbuilder-core==4.16.0",
"botbuilder-applicationinsights==4.16.0",
"botbuilder-schema==4.17.0",
"botframework-connector==4.17.0",
"botbuilder-core==4.17.0",
"botbuilder-applicationinsights==4.17.0",
]
TESTS_REQUIRES = [
"aiounittest==1.3.0",
Expand Down
2 changes: 1 addition & 1 deletion libraries/botbuilder-schema/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from setuptools import setup

NAME = "botbuilder-schema"
VERSION = os.environ["packageVersion"] if "packageVersion" in os.environ else "4.16.0"
VERSION = os.environ["packageVersion"] if "packageVersion" in os.environ else "4.17.0"
REQUIRES = ["msrest== 0.7.*", "urllib3<2.0.0"]

root = os.path.abspath(os.path.dirname(__file__))
Expand Down
2 changes: 1 addition & 1 deletion libraries/botbuilder-testing/botbuilder/testing/about.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

__title__ = "botbuilder-testing"
__version__ = (
os.environ["packageVersion"] if "packageVersion" in os.environ else "4.16.0"
os.environ["packageVersion"] if "packageVersion" in os.environ else "4.17.0"
)
__uri__ = "https://www.github.com/Microsoft/botbuilder-python"
__author__ = "Microsoft"
Expand Down
6 changes: 3 additions & 3 deletions libraries/botbuilder-testing/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
botbuilder-schema==4.16.0
botbuilder-core==4.16.0
botbuilder-dialogs==4.16.0
botbuilder-schema==4.17.0
botbuilder-core==4.17.0
botbuilder-dialogs==4.17.0
aiounittest==1.4.0
8 changes: 4 additions & 4 deletions libraries/botbuilder-testing/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
from setuptools import setup

REQUIRES = [
"botbuilder-schema==4.16.0",
"botbuilder-core==4.16.0",
"botbuilder-dialogs==4.16.0",
"botbuilder-azure==4.16.0",
"botbuilder-schema==4.17.0",
"botbuilder-core==4.17.0",
"botbuilder-dialogs==4.17.0",
"botbuilder-azure==4.17.0",
"pytest~=7.3.1",
]

Expand Down
Loading

0 comments on commit 95ce3b6

Please sign in to comment.