Skip to content

Commit

Permalink
[Core-531] Support on-behalf-of on the service side (#12665)
Browse files Browse the repository at this point in the history
GitOrigin-RevId: 045cfe1bae70eb9ad00a0936b8a94c98f5cdfbed
  • Loading branch information
stephencpope authored and Descartes Labs Build committed Sep 19, 2024
1 parent 7a017cb commit e0e37fe
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
10 changes: 7 additions & 3 deletions descarteslabs/core/client/services/service/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@
from descarteslabs.auth import Auth
from descarteslabs.exceptions import ClientError, ServerError

from ....common.http import Retry, Session
from ....common.http import (
HttpHeaderKeys as CommonHttpHeaderKeys,
Retry,
Session,
)
from ....common.http.authorization import add_bearer
from ....common.threading.local import ThreadLocalWrapper
from ...version import __version__
Expand All @@ -53,17 +57,17 @@ class HttpRequestMethod:
TRACE = "TRACE"


class HttpHeaderKeys:
class HttpHeaderKeys(CommonHttpHeaderKeys):
Accept = "Accept"
Authorization = "Authorization"
ClientSession = "X-Client-Session"
Conda = "X-Conda"
ContentType = "Content-Type"
Notebook = "X-Notebook"
OnBehalfOf = "X-On-Behalf-Of"
Platform = "X-Platform"
Python = "X-Python"
RequestGroup = "X-Request-Group"
RetryAfter = "Retry-After"
UserAgent = "User-Agent"


Expand Down
3 changes: 2 additions & 1 deletion descarteslabs/core/common/http/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@
# limitations under the License.

from .retry import Retry
from .session import HTTPAdapter, ProxyAuthentication, Session
from .session import HTTPAdapter, HttpHeaderKeys, ProxyAuthentication, Session

__all__ = [
"ProxyAuthentication",
"Session",
"HTTPAdapter",
"HttpHeaderKeys",
"Retry",
]

0 comments on commit e0e37fe

Please sign in to comment.