Skip to content

Commit

Permalink
use backend path config value (#63)
Browse files Browse the repository at this point in the history
  • Loading branch information
tizz98 authored Nov 3, 2022
1 parent e8862f4 commit ce9bc95
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.0.12
current_version = 0.0.13
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)
serialize =
{major}.{minor}.{patch}
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
## [0.0.13] - 2022-11-03
### Added
- Use `backend_path` config value when making API requests to Noteable

## [0.0.12] - 2022-11-03
### Added
- Allow user to specify http & websocket protocol for client
Expand Down
2 changes: 1 addition & 1 deletion origami/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version = "0.0.12"
version = "0.0.13"
7 changes: 4 additions & 3 deletions origami/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ class ClientConfig(BaseModel):
http_protocol: str = "https"
websocket_protocol: str = "wss"
domain: str = "app.noteable.io"
backend_path: str = "gate/api/"
backend_path: str = "gate/api"
auth0_domain: str = ""
audience: str = "https://app.noteable.io/gate"
ws_timeout: int = 10
Expand Down Expand Up @@ -151,6 +151,7 @@ def __init__(
self.config.websocket_protocol = os.getenv(
"NOTEABLE_WEBSOCKET_PROTOCOL", self.config.websocket_protocol
)
self.config.backend_path = os.getenv("NOTEABLE_BACKEND_PATH", self.config.backend_path)
self.file_session_cache = {}

self.user = None
Expand Down Expand Up @@ -184,12 +185,12 @@ def origin(self):
@property
def ws_uri(self):
"""Formats the websocket URI out of the notable domain name."""
return f"{self.config.websocket_protocol}://{self.config.domain}/gate/api/v1/rtu"
return f"{self.config.websocket_protocol}://{self.config.domain}/{self.config.backend_path}/v1/rtu"

@property
def api_server_uri(self):
"""Formats the http API URI out of the notable domain name."""
return f"{self.config.http_protocol}://{self.config.domain}/gate/api"
return f"{self.config.http_protocol}://{self.config.domain}/{self.config.backend_path}"

def get_token(self):
"""Fetches and api token using oauth client config settings.
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

[tool.poetry]
name = "noteable-origami"
version = "0.0.12"
version = "0.0.13"
description = "The Noteable API interface"
authors = ["Matt Seal <[email protected]>"]
maintainers = ["Matt Seal <[email protected]>"]
Expand Down

0 comments on commit ce9bc95

Please sign in to comment.