Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
mslhrotk committed Sep 27, 2024
1 parent 55eaefa commit ec12ada
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ trait HasCognitiveServiceInput extends HasURL with HasSubscriptionKey with HasAA
val providedCustomAuthHeader = getValueOpt(row, CustomAuthHeader)
if (providedCustomAuthHeader .isEmpty && PlatformDetails.runningOnFabric()) {
logInfo("Using Default AAD Token On Fabric")
Option(FabricClient.getCognitiveAuthHeader)
Option(FabricClient.getCognitiveMWCTokenAuthHeader)
} else {
providedCustomAuthHeader
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ object FabricClient extends RESTUtils {

private def getHeaders: Map[String, String] = {
Map(
"Authorization" -> s"${getMLWorkloadAuthHeader}",
"Authorization" -> s"${getMLWorkloadAADAuthHeader}",
"RequestId" -> UUID.randomUUID().toString,
"Content-Type" -> "application/json",
"x-ms-workload-resource-moniker" -> UUID.randomUUID().toString
Expand All @@ -144,9 +144,9 @@ object FabricClient extends RESTUtils {
usagePost(url, body, getHeaders);
}

def getMLWorkloadAuthHeader: String = TokenLibrary.getMLWorkloadAuthHeader
def getMLWorkloadAADAuthHeader: String = TokenLibrary.getMLWorkloadAADAuthHeader

def getCognitiveAuthHeader: String = {
TokenLibrary.getCognitiveAuthHeader(WorkspaceID.getOrElse(""), ArtifactID.getOrElse(""))
def getCognitiveMWCTokenAuthHeader: String = {
TokenLibrary.getCognitiveMwcTokenAuthHeader(WorkspaceID.getOrElse(""), ArtifactID.getOrElse(""))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ object TokenLibrary {
}


def getMLWorkloadAuthHeader: String = "Bearer " + getAccessToken
def getMLWorkloadAADAuthHeader: String = "Bearer " + getAccessToken

def getCognitiveAuthHeader(workspaceId: String, artifactId: String): String = "MwcToken " +
def getCognitiveMwcTokenAuthHeader(workspaceId: String, artifactId: String): String = "MwcToken " +
getSparkMwcToken(workspaceId, artifactId)
}

0 comments on commit ec12ada

Please sign in to comment.