forked from Azure/azure-sdk-for-java
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add default log options to TA and FR (Azure#20914)
- Loading branch information
Showing
4 changed files
with
87 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
...ai-formrecognizer/src/main/java/com/azure/ai/formrecognizer/implementation/Constants.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
package com.azure.ai.formrecognizer.implementation; | ||
|
||
import com.azure.core.http.policy.HttpLogOptions; | ||
|
||
import java.util.function.Supplier; | ||
|
||
public class Constants { | ||
|
||
public static final Supplier<HttpLogOptions> DEFAULT_LOG_OPTIONS_SUPPLIER = () -> { | ||
HttpLogOptions logOptions = new HttpLogOptions(); | ||
|
||
logOptions.addAllowedHeaderName("Operation-Location"); | ||
logOptions.addAllowedHeaderName("Location"); | ||
logOptions.addAllowedHeaderName("x-envoy-upstream-service-time"); | ||
logOptions.addAllowedHeaderName("apim-request-id"); | ||
logOptions.addAllowedHeaderName("Strict-Transport-Security"); | ||
logOptions.addAllowedHeaderName("x-content-type-options"); | ||
logOptions.addAllowedHeaderName("ms-azure-ai-errorcode"); | ||
logOptions.addAllowedHeaderName("x-ms-cs-error-code"); | ||
|
||
logOptions.addAllowedQueryParamName("includeTextDetails"); | ||
logOptions.addAllowedQueryParamName("locale"); | ||
logOptions.addAllowedQueryParamName("language"); | ||
logOptions.addAllowedQueryParamName("includeKeys"); | ||
logOptions.addAllowedQueryParamName("op"); | ||
logOptions.addAllowedQueryParamName("pages"); | ||
logOptions.addAllowedQueryParamName("readingOrder"); | ||
|
||
return logOptions; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
...e-ai-textanalytics/src/main/java/com/azure/ai/textanalytics/implementation/Constants.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. | ||
|
||
package com.azure.ai.textanalytics.implementation; | ||
|
||
import com.azure.core.http.policy.HttpLogOptions; | ||
|
||
import java.util.function.Supplier; | ||
|
||
public class Constants { | ||
|
||
public static final Supplier<HttpLogOptions> DEFAULT_LOG_OPTIONS_SUPPLIER = () -> { | ||
HttpLogOptions logOptions = new HttpLogOptions(); | ||
|
||
logOptions.addAllowedHeaderName("Operation-Location"); | ||
logOptions.addAllowedHeaderName("x-envoy-upstream-service-time"); | ||
logOptions.addAllowedHeaderName("apim-request-id"); | ||
logOptions.addAllowedHeaderName("Strict-Transport-Security"); | ||
logOptions.addAllowedHeaderName("x-content-type-options"); | ||
|
||
logOptions.addAllowedQueryParamName("jobId"); | ||
logOptions.addAllowedQueryParamName("$top"); | ||
logOptions.addAllowedQueryParamName("$skip"); | ||
logOptions.addAllowedQueryParamName("showStats"); | ||
logOptions.addAllowedQueryParamName("model-version"); | ||
logOptions.addAllowedQueryParamName("domain"); | ||
logOptions.addAllowedQueryParamName("stringIndexType"); | ||
logOptions.addAllowedQueryParamName("piiCategories"); | ||
logOptions.addAllowedQueryParamName("opinionMining"); | ||
|
||
return logOptions; | ||
}; | ||
} |