From 28cebe8f44afb413d3da8934906eedb4bf6f37fe Mon Sep 17 00:00:00 2001 From: Nikitha Chettiar Date: Mon, 3 May 2021 11:23:18 -0700 Subject: [PATCH 1/5] Adding custom urls requirement. --- GraphClientFactory.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/GraphClientFactory.md b/GraphClientFactory.md index a446806..8815ceb 100644 --- a/GraphClientFactory.md +++ b/GraphClientFactory.md @@ -18,7 +18,14 @@ There are two primary usage scenarios for the client factory. Developers who wi - Set the SdkVersion header with the appropriate moniker based on the following structure `graph-{lang}-{version}`. - Enable the developer to select a supported sovereign cloud using an enumerated list. Selecting the sovereign cloud should ensure that the AuthenticationProvider uses the appropriate Authentication Endpoint. - Enable a developer to configure a HTTP proxy that will be used for outgoing requests. - +- Enable a developer provide custom URLs or endpoints. + - `CustomURLs` option should be set on client creation. + - These URLs are different from the Graph service endpoints on the national clouds. + - Certain workloads error out when an unexpected header is present in the request. The middlewares should check: + - If the request URL is a Graph serve endpoint or a custom url provided by the developer, then append request headers or modify the request content. + - Else the middleware should delete request headers added by that middleware. + - Provide capabilities to modify or update the `CustomURLs` option after the client creation. + ## Performance Considerations - If available on the platform, enable gzip compression of requests and responses. From 67600ec34bc7be7d049e76dc98e7902e32e7456b Mon Sep 17 00:00:00 2001 From: Nikitha Chettiar Date: Mon, 3 May 2021 11:25:40 -0700 Subject: [PATCH 2/5] Update AuthorizationHandler.md --- middleware/AuthorizationHandler.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/middleware/AuthorizationHandler.md b/middleware/AuthorizationHandler.md index 05f8ded..ad9c3c0 100644 --- a/middleware/AuthorizationHandler.md +++ b/middleware/AuthorizationHandler.md @@ -10,6 +10,10 @@ A piece of client-side middleware intended to allow the use of an authorization - Transparently authorize requests - Accept AuthorizationProvider instance in constructor - Update Authorization Header +- Certain workloads error out when an unexpected header is present in the request. The middlewares should check: + - If the request URL is a Graph serve endpoint or a custom url provided by the developer, then append or update the authorization header. + - Else the middleware should delete authorization header. + Take a request object and use authorization provider to add Authorization header. From dda579b25992063e05cc9f68afd00a6ac9115e09 Mon Sep 17 00:00:00 2001 From: Nikitha Chettiar Date: Mon, 3 May 2021 11:26:41 -0700 Subject: [PATCH 3/5] Update TelemetryHandler.md --- middleware/TelemetryHandler.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/middleware/TelemetryHandler.md b/middleware/TelemetryHandler.md index aad98cc..f6a5d39 100644 --- a/middleware/TelemetryHandler.md +++ b/middleware/TelemetryHandler.md @@ -36,6 +36,10 @@ Provide a mandatory middleware component that attaches metadata to a Graph reque - `RuntimeEnvironment: Node/1.1` for JavaScript. - `RuntimeEnvironment: JRE/1.1` for Java. +- Certain workloads error out when an unexpected header is present in the request. The middlewares should check: + - If the request URL is a Graph serve endpoint or a custom url provided by the developer, then append or update the telemetry headers. + - Else the middleware should delete telemetry header. + #### Ideal Metadata Capture ``` SdkVersion: graph-dotnet-beta/0.6.0-preview, graph-dotnet-core/1.16.0 (featureUsage=0f) From 888fccbd858b02e8419ed6e6888d7329c75dea4d Mon Sep 17 00:00:00 2001 From: Nikitha Chettiar Date: Wed, 12 May 2021 14:26:05 -0700 Subject: [PATCH 4/5] Update GraphClientFactory.md --- GraphClientFactory.md | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/GraphClientFactory.md b/GraphClientFactory.md index 8815ceb..10c0d71 100644 --- a/GraphClientFactory.md +++ b/GraphClientFactory.md @@ -18,18 +18,31 @@ There are two primary usage scenarios for the client factory. Developers who wi - Set the SdkVersion header with the appropriate moniker based on the following structure `graph-{lang}-{version}`. - Enable the developer to select a supported sovereign cloud using an enumerated list. Selecting the sovereign cloud should ensure that the AuthenticationProvider uses the appropriate Authentication Endpoint. - Enable a developer to configure a HTTP proxy that will be used for outgoing requests. -- Enable a developer provide custom URLs or endpoints. - - `CustomURLs` option should be set on client creation. +- Enable a developer to provide custom hosts. + - `CustomHosts` option should be set on client creation. + - `CustomHosts` option should be made available in the `Context` so that it is available to the middleware during request processing. - These URLs are different from the Graph service endpoints on the national clouds. - Certain workloads error out when an unexpected header is present in the request. The middlewares should check: - - If the request URL is a Graph serve endpoint or a custom url provided by the developer, then append request headers or modify the request content. + - If the request URL is a Graph service endpoint or a custom host provided by the developer, then append request headers or modify the request content. - Else the middleware should delete request headers added by that middleware. + - Example of an workload error - [LargeFileUploadTask upload to OneDrive caused CORS error due `SDKVersion` telemetry header](https://github.com/microsoftgraph/msgraph-sdk-javascript/issues/265) - Provide capabilities to modify or update the `CustomURLs` option after the client creation. ## Performance Considerations - If available on the platform, enable gzip compression of requests and responses. +## Future Implementation + +- Enable developers to set `CustomHosts`. The progress can be tracked as follows: +``` +| SDK | Implementation Status| +|-------------|----------------------| +| C# | - | +| JAVA | - | +| PHP | - | +| JavaScript | In Progress | +``` ## Security Considerations - If available on the platform, configure for TLS 1.2 From df6750a43b13d02cbfb2eef50916a1db77c14660 Mon Sep 17 00:00:00 2001 From: Nikitha Chettiar Date: Thu, 20 May 2021 00:01:53 -0700 Subject: [PATCH 5/5] updating to customhosts --- GraphClientFactory.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GraphClientFactory.md b/GraphClientFactory.md index 10c0d71..d1cbb3b 100644 --- a/GraphClientFactory.md +++ b/GraphClientFactory.md @@ -21,12 +21,12 @@ There are two primary usage scenarios for the client factory. Developers who wi - Enable a developer to provide custom hosts. - `CustomHosts` option should be set on client creation. - `CustomHosts` option should be made available in the `Context` so that it is available to the middleware during request processing. - - These URLs are different from the Graph service endpoints on the national clouds. + - These hostnames are different from the Graph service endpoints on the national clouds. - Certain workloads error out when an unexpected header is present in the request. The middlewares should check: - If the request URL is a Graph service endpoint or a custom host provided by the developer, then append request headers or modify the request content. - Else the middleware should delete request headers added by that middleware. - Example of an workload error - [LargeFileUploadTask upload to OneDrive caused CORS error due `SDKVersion` telemetry header](https://github.com/microsoftgraph/msgraph-sdk-javascript/issues/265) - - Provide capabilities to modify or update the `CustomURLs` option after the client creation. + - Provide capabilities to modify or update the `CustomHosts` option after the client creation. ## Performance Considerations