-
Notifications
You must be signed in to change notification settings - Fork 831
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: Support Token Provider Mode #2160
chore: Support Token Provider Mode #2160
Conversation
/azp run |
Hey @lhrotk 👋! We use semantic commit messages to streamline the release process. Examples of commit messages with semantic prefixes:
To test your commit locally, please follow our guild on building from source. |
Azure Pipelines successfully started running 1 pipeline(s). |
a7db643
to
ffa21ac
Compare
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
ffa21ac
to
8122f86
Compare
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
build.sbt
Outdated
@@ -32,6 +32,8 @@ val extraDependencies = Seq( | |||
"org.scalactic" %% "scalactic" % "3.2.14", | |||
"io.spray" %% "spray-json" % "1.3.5", | |||
"com.jcraft" % "jsch" % "0.1.54", | |||
"com.pauldijou" %% "jwt-core" % "3.0.0", | |||
"org.json" % "json" % "20180130", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use existing spray parsing dep please
build.sbt
Outdated
@@ -32,6 +32,8 @@ val extraDependencies = Seq( | |||
"org.scalactic" %% "scalactic" % "3.2.14", | |||
"io.spray" %% "spray-json" % "1.3.5", | |||
"com.jcraft" % "jsch" % "0.1.54", | |||
"com.pauldijou" %% "jwt-core" % "3.0.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we have some code that parses jwt, check the certified events logging code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't find any jwt related code, I am reading this: certified_event, can you point me to the right place
core/src/main/scala/com/microsoft/azure/synapse/ml/fabric/OpenAITokenLibrary.scala
Show resolved
Hide resolved
a739978
to
aeb302d
Compare
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
cognitive/src/main/scala/com/microsoft/azure/synapse/ml/services/openai/OpenAI.scala
Outdated
Show resolved
Hide resolved
cognitive/src/main/scala/com/microsoft/azure/synapse/ml/services/CognitiveServiceBase.scala
Outdated
Show resolved
Hide resolved
core/src/main/scala/com/microsoft/azure/synapse/ml/fabric/FabricClient.scala
Outdated
Show resolved
Hide resolved
core/src/main/scala/com/microsoft/azure/synapse/ml/fabric/FabricClient.scala
Outdated
Show resolved
Hide resolved
core/src/main/scala/com/microsoft/azure/synapse/ml/fabric/FabricClient.scala
Outdated
Show resolved
Hide resolved
core/src/main/scala/com/microsoft/azure/synapse/ml/fabric/FabricClient.scala
Outdated
Show resolved
Hide resolved
core/src/main/scala/com/microsoft/azure/synapse/ml/fabric/FabricClient.scala
Outdated
Show resolved
Hide resolved
import spray.json.DefaultJsonProtocol.StringJsonFormat | ||
|
||
object OpenAITokenLibrary extends SynapseMLLogging with AuthHeaderProvider { | ||
var MLMWCToken = ""; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we try to eliminate this var by making it a def or something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need another var to tell it is mwc token or aad token and I think it is strange to change value of another var in def for this var. And also this var is a catched token and will expire sometime while def is called only once, wdyt?
core/src/main/scala/com/microsoft/azure/synapse/ml/logging/fabric/CertifiedEventClient.scala
Outdated
Show resolved
Hide resolved
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
@@ -244,6 +247,19 @@ trait HasOpenAITextParams extends HasOpenAISharedParams { | |||
} | |||
} | |||
|
|||
trait HasOpenAICognitiveServiceInput extends HasCognitiveServiceInput { | |||
override protected def getCustomAuthHeader(row: Row): Option[String] = { | |||
var providedCustomHeader = getValueOpt(row, CustomAuthHeader) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
var
case _: Exception => | ||
// Handle MalformedURLException or other exceptions | ||
None | ||
} | ||
case None => | ||
None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we expect these branches to be triggered ever?
core/src/main/scala/com/microsoft/azure/synapse/ml/fabric/OpenAITokenLibrary.scala
Outdated
Show resolved
Hide resolved
|
||
class JwtTokenExpiryMissingException(message: String) extends Exception(message) | ||
|
||
class FabricTokenParser(JWToken: String) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make all the APIs private or private[ml] if they arent supposed to be used by a end user
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
What changes are proposed in this pull request?
Support token provider auth mode, auto refresh token while job is running.
How is this patch tested?
Does this PR change any dependencies?
Does this PR add a new feature? If so, have you added samples on website?