Skip to content

Commit 846050c

Browse files
authored
Merge branch 'master' into github-actions-ci
2 parents 35332d0 + 3733cbf commit 846050c

File tree

7 files changed

+63
-59
lines changed

7 files changed

+63
-59
lines changed

CHANGELOG.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,15 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7-
## [Unreleased]
7+
## [1.13.0] - 2022-12-02
8+
9+
### Added
10+
- When running rsconnect bootstrap, you can now specify the jwt secret using the CONNECT_BOOTSTRAP_SECRETKEY environment variable.
811

912
### Changed
13+
- Update pip_freeze to use `pip freeze` since Connect filters for valid package paths in the backend and it no longer depends on the undocumented behavior of `pip list --format=freeze`. This reverts the change made in 1.5.2.
1014

11-
Update pip_freeze to use `pip freeze` since Connect filters for valid package paths in the backend and it no longer depends on the undocumented behavior of `pip list --format=freeze`. This reverts the change made in 1.5.2.
15+
- Renamed the deploy_html `excludes` flag to `exclude` for consistency with other deploy commands.
1216

1317
## [1.12.1] - 2022-11-07
1418

rsconnect/actions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,8 @@ def test_server(connect_server):
225225
raise RSConnectException("\n".join(failures))
226226

227227

228-
def test_rstudio_server(server: api.RStudioServer):
229-
with api.RStudioClient(server) as client:
228+
def test_rstudio_server(server: api.PositServer):
229+
with api.PositClient(server) as client:
230230
try:
231231
result = client.get_current_user()
232232
server.handle_bad_response(result)

rsconnect/api.py

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ def handle_bad_response(self, response):
6464
)
6565

6666

67-
class RStudioServer(AbstractRemoteServer):
67+
class PositServer(AbstractRemoteServer):
6868
"""
69-
A class used to represent the server of the shinyapps.io and RStudio Cloud APIs.
69+
A class used to represent the server of the shinyapps.io and Posit Cloud APIs.
7070
"""
7171

7272
def __init__(self, remote_name: str, url: str, account_name: str, token: str, secret: str):
@@ -76,7 +76,7 @@ def __init__(self, remote_name: str, url: str, account_name: str, token: str, se
7676
self.secret = secret
7777

7878

79-
class ShinyappsServer(RStudioServer):
79+
class ShinyappsServer(PositServer):
8080
"""
8181
A class to encapsulate the information needed to interact with an
8282
instance of the shinyapps.io server.
@@ -89,16 +89,16 @@ def __init__(self, url: str, account_name: str, token: str, secret: str):
8989
super().__init__(remote_name=remote_name, url=url, account_name=account_name, token=token, secret=secret)
9090

9191

92-
class CloudServer(RStudioServer):
92+
class CloudServer(PositServer):
9393
"""
9494
A class to encapsulate the information needed to interact with an
95-
instance of the RStudio Cloud server.
95+
instance of the Posit Cloud server.
9696
"""
9797

9898
def __init__(self, url: str, account_name: str, token: str, secret: str):
99-
remote_name = "RStudio Cloud"
100-
if url == "rstudio.cloud" or url is None:
101-
url = "https://api.rstudio.cloud"
99+
remote_name = "Posit Cloud"
100+
if url in {"posit.cloud", "rstudio.cloud", None}:
101+
url = "https://api.posit.cloud"
102102
super().__init__(remote_name=remote_name, url=url, account_name=account_name, token=token, secret=secret)
103103

104104

@@ -475,7 +475,7 @@ def setup_remote_server(
475475
if api_key:
476476
self.remote_server = RSConnectServer(url, api_key, insecure, ca_data)
477477
elif token and secret:
478-
if url and "rstudio.cloud" in url:
478+
if url and ("rstudio.cloud" in url or "posit.cloud" in url):
479479
self.remote_server = CloudServer(url, account_name, token, secret)
480480
else:
481481
self.remote_server = ShinyappsServer(url, account_name, token, secret)
@@ -485,8 +485,8 @@ def setup_remote_server(
485485
def setup_client(self, cookies=None, timeout=30, **kwargs):
486486
if isinstance(self.remote_server, RSConnectServer):
487487
self.client = RSConnectClient(self.remote_server, cookies, timeout)
488-
elif isinstance(self.remote_server, RStudioServer):
489-
self.client = RStudioClient(self.remote_server, timeout)
488+
elif isinstance(self.remote_server, PositServer):
489+
self.client = PositClient(self.remote_server, timeout)
490490
else:
491491
raise RSConnectException("Unable to infer Connect client.")
492492

@@ -515,7 +515,7 @@ def validate_server(
515515
):
516516
if (url and api_key) or isinstance(self.remote_server, RSConnectServer):
517517
self.validate_connect_server(name, url, api_key, insecure, cacert, api_key_is_required)
518-
elif (url and token and secret) or isinstance(self.remote_server, RStudioServer):
518+
elif (url and token and secret) or isinstance(self.remote_server, PositServer):
519519
self.validate_rstudio_server(url, account_name, token, secret)
520520
else:
521521
raise RSConnectException("Unable to validate server from information provided.")
@@ -596,11 +596,11 @@ def validate_rstudio_server(
596596
secret = secret or self.remote_server.secret
597597
server = (
598598
CloudServer(url, account_name, token, secret)
599-
if "rstudio.cloud" in url
599+
if "rstudio.cloud" in url or "posit.cloud" in url
600600
else ShinyappsServer(url, account_name, token, secret)
601601
)
602602

603-
with RStudioClient(server) as client:
603+
with PositClient(server) as client:
604604
try:
605605
result = client.get_current_user()
606606
server.handle_bad_response(result)
@@ -657,7 +657,7 @@ def check_server_capabilities(self, capability_functions):
657657
:param details_source: the source for obtaining server details, gather_server_details(),
658658
by default.
659659
"""
660-
if isinstance(self.remote_server, RStudioServer):
660+
if isinstance(self.remote_server, PositServer):
661661
return self
662662

663663
details = self.server_details
@@ -847,7 +847,7 @@ def validate_app_mode(self, *args, **kwargs):
847847
if isinstance(self.remote_server, RSConnectServer):
848848
app = get_app_info(self.remote_server, app_id)
849849
existing_app_mode = AppModes.get_by_ordinal(app.get("app_mode", 0), True)
850-
elif isinstance(self.remote_server, RStudioServer):
850+
elif isinstance(self.remote_server, PositServer):
851851
app = get_rstudio_app_info(self.remote_server, app_id)
852852
existing_app_mode = AppModes.get_by_cloud_name(app.json_data["mode"])
853853
else:
@@ -1008,14 +1008,14 @@ def __init__(
10081008
self.output_id = output_id
10091009

10101010

1011-
class RStudioClient(HTTPServer):
1011+
class PositClient(HTTPServer):
10121012
"""
1013-
An HTTP client to call the RStudio Cloud and shinyapps.io APIs.
1013+
An HTTP client to call the Posit Cloud and shinyapps.io APIs.
10141014
"""
10151015

10161016
_TERMINAL_STATUSES = {"success", "failed", "error"}
10171017

1018-
def __init__(self, rstudio_server: RStudioServer, timeout: int = 30):
1018+
def __init__(self, rstudio_server: PositServer, timeout: int = 30):
10191019
self._token = rstudio_server.token
10201020
try:
10211021
self._key = base64.b64decode(rstudio_server.secret)
@@ -1156,7 +1156,7 @@ class ShinyappsService:
11561156
Encapsulates operations involving multiple API calls to shinyapps.io.
11571157
"""
11581158

1159-
def __init__(self, rstudio_client: RStudioClient, server: ShinyappsServer):
1159+
def __init__(self, rstudio_client: PositClient, server: ShinyappsServer):
11601160
self._rstudio_client = rstudio_client
11611161
self._server = server
11621162

@@ -1202,10 +1202,10 @@ def do_deploy(self, bundle_id, app_id):
12021202

12031203
class CloudService:
12041204
"""
1205-
Encapsulates operations involving multiple API calls to RStudio Cloud.
1205+
Encapsulates operations involving multiple API calls to Posit Cloud.
12061206
"""
12071207

1208-
def __init__(self, rstudio_client: RStudioClient, server: CloudServer):
1208+
def __init__(self, rstudio_client: PositClient, server: CloudServer):
12091209
self._rstudio_client = rstudio_client
12101210
self._server = server
12111211

@@ -1332,7 +1332,7 @@ def get_app_info(connect_server, app_id):
13321332

13331333

13341334
def get_rstudio_app_info(server, app_id):
1335-
with RStudioClient(server) as client:
1335+
with PositClient(server) as client:
13361336
result = client.get_application(app_id)
13371337
server.handle_bad_response(result)
13381338
return result
@@ -1541,7 +1541,7 @@ def find_unique_name(remote_server: TargetableServer, name: str):
15411541
mapping_function=lambda client, app: app["name"],
15421542
)
15431543
elif isinstance(remote_server, ShinyappsServer):
1544-
client = RStudioClient(remote_server)
1544+
client = PositClient(remote_server)
15451545
existing_names = client.get_applications_like_name(name)
15461546
else:
15471547
# non-unique names are permitted in cloud

rsconnect/bundle.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,8 @@ def write_manifest(
190190
nb_name: str,
191191
environment: Environment,
192192
output_dir: str,
193-
hide_all_input: bool,
194-
hide_tagged_input: bool,
193+
hide_all_input: bool = False,
194+
hide_tagged_input: bool = False,
195195
image: str = None,
196196
) -> typing.Tuple[list, list]:
197197
"""Create a manifest for source publishing the specified notebook.

rsconnect/main.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -152,13 +152,13 @@ def rstudio_args(func):
152152
"--token",
153153
"-T",
154154
envvar=["SHINYAPPS_TOKEN", "RSCLOUD_TOKEN"],
155-
help="The shinyapps.io/RStudio Cloud token.",
155+
help="The shinyapps.io/Posit Cloud token.",
156156
)
157157
@click.option(
158158
"--secret",
159159
"-S",
160160
envvar=["SHINYAPPS_SECRET", "RSCLOUD_SECRET"],
161-
help="The shinyapps.io/RStudio Cloud token secret.",
161+
help="The shinyapps.io/Posit Cloud token secret.",
162162
)
163163
@functools.wraps(func)
164164
def wrapper(*args, **kwargs):
@@ -245,8 +245,9 @@ def cli(future):
245245
certificate file to use for TLS. The last two items are only relevant if the
246246
URL specifies the "https" protocol.
247247
248-
For RStudio Cloud and shinyapps.io, the information needed to connect includes
249-
the account, auth token, auth secret, and server ('rstudio.cloud' or 'shinyapps.io').
248+
For Posit Cloud, the information needed to connect includes the auth token, auth
249+
secret, and server ('posit.cloud'). For shinyapps.io, the auth token, auth secret,
250+
server ('shinyapps.io'), and account are needed.
250251
"""
251252
global future_enabled
252253
future_enabled = future
@@ -284,7 +285,7 @@ def _test_server_and_api(server, api_key, insecure, ca_cert):
284285
return real_server, me
285286

286287

287-
def _test_rstudio_creds(server: api.RStudioServer):
288+
def _test_rstudio_creds(server: api.PositServer):
288289
with cli_feedback("Checking {} credential".format(server.remote_name)):
289290
test_rstudio_server(server)
290291

@@ -433,7 +434,7 @@ def add(ctx, name, server, api_key, insecure, cacert, account, token, secret, ve
433434
old_server = server_store.get_by_name(name)
434435

435436
if token:
436-
if server and "rstudio.cloud" in server:
437+
if server and ("rstudio.cloud" in server or "posit.cloud" in server):
437438
real_server = api.CloudServer(server, account, token, secret)
438439
else:
439440
real_server = api.ShinyappsServer(server, account, token, secret)
@@ -1040,7 +1041,6 @@ def deploy_quarto(
10401041
)
10411042
@click.option(
10421043
"--exclude",
1043-
"--excludes",
10441044
"-x",
10451045
multiple=True,
10461046
help=(
@@ -1061,7 +1061,7 @@ def deploy_html(
10611061
path: str = None,
10621062
entrypoint: str = None,
10631063
extra_files=None,
1064-
excludes=None,
1064+
exclude=None,
10651065
title: str = None,
10661066
env_vars: typing.Dict[str, str] = None,
10671067
verbose: bool = False,
@@ -1089,7 +1089,7 @@ def deploy_html(
10891089
path,
10901090
entrypoint,
10911091
extra_files,
1092-
excludes,
1092+
exclude,
10931093
)
10941094
.deploy_bundle()
10951095
.save_deployed_info()

rsconnect/validation.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ def validate_connection_options(url, api_key, insecure, cacert, account_name, to
3535

3636
if present_connect_options and present_shinyapps_options:
3737
raise RSConnectException(
38-
"Connect options ({}) may not be passed alongside shinyapps.io or RStudio Cloud options ({}).".format(
38+
"Connect options ({}) may not be passed alongside shinyapps.io or Posit Cloud options ({}).".format(
3939
", ".join(present_connect_options), ", ".join(present_shinyapps_options)
4040
)
4141
)
4242

43-
if url and 'rstudio.cloud' in url:
43+
if url and ('posit.cloud' in url or 'rstudio.cloud' in url):
4444
if len(present_cloud_options) != len(cloud_options):
4545
raise RSConnectException(
46-
"-T/--token and -S/--secret must be provided for RStudio Cloud."
46+
"-T/--token and -S/--secret must be provided for Posit Cloud."
4747
)
4848
elif present_shinyapps_options:
4949
if len(present_shinyapps_options) != len(shinyapps_options):

0 commit comments

Comments
 (0)