Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 51 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,56 @@ RUN apt-get update; \
apt-get clean -y; \
rm -rf /var/lib/apt/lists/*

RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
ENV NVM_DIR=/root/.nvm
RUN . "$NVM_DIR/nvm.sh" && nvm install ${NODE_VERSION}
RUN . "$NVM_DIR/nvm.sh" && nvm use v${NODE_VERSION}
RUN . "$NVM_DIR/nvm.sh" && nvm alias default v${NODE_VERSION}
ENV PATH="/root/.nvm/versions/node/v${NODE_VERSION}/bin/:${PATH}"
RUN node --version
RUN npm --version
ENV NODE_VERSION 18.15.0

RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
&& case "${dpkgArch##*-}" in \
amd64) ARCH='x64';; \
ppc64el) ARCH='ppc64le';; \
s390x) ARCH='s390x';; \
arm64) ARCH='arm64';; \
armhf) ARCH='armv7l';; \
i386) ARCH='x86';; \
*) echo "unsupported architecture"; exit 1 ;; \
esac \
&& set -ex \
# libatomic1 for arm
&& apt-get update && apt-get install -y ca-certificates curl wget gnupg dirmngr xz-utils libatomic1 --no-install-recommends \
&& rm -rf /var/lib/apt/lists/* \
&& for key in \
4ED778F539E3634C779C87C6D7062848A1AB005C \
141F07595B7B3FFE74309A937405533BE57C7D57 \
74F12602B6F1C4E913FAA37AD3A89613643B6201 \
DD792F5973C6DE52C432CBDAC77ABFA00DDBF2B7 \
61FC681DFB92A079F1685E77973F295594EC4689 \
8FCCA13FEF1D0C2E91008E09770F7A9A5AE15600 \
C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8 \
890C08DB8579162FEE0DF9DB8BEAB4DFCF555EF4 \
C82FA3AE1CBEDC6BE46B9360C43CEC45C17AB93C \
108F52B48DB57BB0CC439B2997B01419BD92F80A \
; do \
gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys "$key" || \
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" ; \
done \
&& curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-$ARCH.tar.xz" \
&& curl -fsSLO --compressed "https://nodejs.org/dist/v$NODE_VERSION/SHASUMS256.txt.asc" \
&& gpg --batch --decrypt --output SHASUMS256.txt SHASUMS256.txt.asc \
&& grep " node-v$NODE_VERSION-linux-$ARCH.tar.xz\$" SHASUMS256.txt | sha256sum -c - \
&& tar -xJf "node-v$NODE_VERSION-linux-$ARCH.tar.xz" -C /usr/local --strip-components=1 --no-same-owner \
&& rm "node-v$NODE_VERSION-linux-$ARCH.tar.xz" SHASUMS256.txt.asc SHASUMS256.txt \
&& apt-mark auto '.*' > /dev/null \
&& find /usr/local -type f -executable -exec ldd '{}' ';' \
| awk '/=>/ { print $(NF-1) }' \
| sort -u \
| xargs -r dpkg-query --search \
| cut -d: -f1 \
| sort -u \
| xargs -r apt-mark manual \
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
&& ln -s /usr/local/bin/node /usr/local/bin/nodejs \
# smoke tests
&& node --version \
&& npm --version

ARG RUNNER_VERSION

Expand Down Expand Up @@ -53,7 +95,7 @@ RUN chmod 755 /usr/local/bin/extension-test

RUN mkdir /banners

COPY ./banner* /banners
COPY ./banner* /banners/

COPY ./entrypoint.sh /entrypoint.sh
RUN chmod 755 /entrypoint.sh
Expand Down
2 changes: 1 addition & 1 deletion connect/eaas/runner/handlers/anvil.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
import logging

import anvil.server

from connect.client import (
ConnectClient,
)

from connect.eaas.core.logging import (
RequestLogger,
)
Expand Down
1 change: 0 additions & 1 deletion connect/eaas/runner/handlers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
AsyncConnectClient,
ConnectClient,
)

from connect.eaas.core.logging import (
ExtensionLogHandler,
RequestLogger,
Expand Down
7 changes: 4 additions & 3 deletions connect/eaas/runner/handlers/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
import inspect
import logging

from connect.client import (
ClientError,
)
from fastapi import (
FastAPI,
)
Expand All @@ -22,6 +19,9 @@
BaseHTTPMiddleware,
)

from connect.client import (
ClientError,
)
from connect.eaas.core.decorators import (
router as root_router,
)
Expand Down Expand Up @@ -165,6 +165,7 @@ def get_asgi_application(self):
auth, no_auth = self.get_application().get_routers()
app.include_router(auth, prefix='/api')
app.include_router(no_auth, prefix='/guest')
app.include_router(no_auth, prefix='/unauthorized')
app.openapi = functools.partial(self.get_api_schema, app)
static_root = self.get_application().get_static_root()
if static_root:
Expand Down
8 changes: 4 additions & 4 deletions connect/eaas/runner/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@
)

import requests
from connect.client import (
ClientError,
ConnectClient,
)
from rich import (
box,
)
Expand All @@ -38,6 +34,10 @@
Table,
)

from connect.client import (
ClientError,
ConnectClient,
)
from connect.eaas.core.validation.models import (
ValidationItem,
ValidationResult,
Expand Down
1 change: 0 additions & 1 deletion connect/eaas/runner/managers/background.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
from connect.client.models import (
AsyncResource,
)

from connect.eaas.core.enums import (
ResultType,
)
Expand Down
1 change: 0 additions & 1 deletion connect/eaas/runner/managers/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
from connect.client.models import (
AsyncCollection,
)

from connect.eaas.core.enums import (
TaskCategory,
)
Expand Down
10 changes: 5 additions & 5 deletions connect/eaas/runner/managers/transformation.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@
)

import requests
from openpyxl import (
Workbook,
load_workbook,
)

from connect.client import (
AsyncConnectClient,
)
from connect.client.models import (
AsyncResource,
)
from openpyxl import (
Workbook,
load_workbook,
)

from connect.eaas.core.enums import (
ResultType,
)
Expand Down
70 changes: 42 additions & 28 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ websockets = "10.*"
connect-openapi-client = ">=25.16"
logzio-python-handler = "^3.0.0"
backoff = "^1.11.1"
uvloop = "^0.16.0"
connect-eaas-core = ">=27.8,<28"
connect-eaas-core = ">=27.9,<28"
httpx = "^0.23.0"
rich = "^12.5.1"
pyfiglet = "^0.8.post1"
devtools = "^0.9.0"
watchfiles = "^0.17.0"
openpyxl = "^3.0.10"
lxml = "^4.9.2"
uvloop = "^0.17.0"

[tool.poetry.group.test.dependencies]
pytest = "^7.2.1"
Expand Down Expand Up @@ -107,6 +107,7 @@ asyncio_mode = "strict"
[tool.isort]
src_paths = "*"
sections = ["FUTURE", "STDLIB", "THIRDPARTY", "FIRSTPARTY", "LOCALFOLDER"]
known_first_party = ["connect"]
group_by_package = true
multi_line_output = 3
force_grid_wrap = 1
Expand Down
21 changes: 16 additions & 5 deletions tests/handlers/test_web.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import os

import pytest
from connect.client import (
ClientError,
ConnectClient,
)
from fastapi import (
Depends,
Header,
Expand All @@ -16,11 +12,16 @@
BaseHTTPMiddleware,
)

from connect.client import (
ClientError,
ConnectClient,
)
from connect.eaas.core.decorators import (
account_settings_page,
admin_pages,
guest,
module_pages,
unauthorized,
web_app,
)
from connect.eaas.core.extension import (
Expand Down Expand Up @@ -321,8 +322,13 @@ def get_static_root(cls):
def example_auth(self):
return

@router.get('/no_auth')
@router.get('/no_auth_deprecated')
@guest()
def example_no_auth_deprecated(self):
return

@router.get('/no_auth')
@unauthorized()
def example_no_auth(self):
return

Expand All @@ -344,6 +350,11 @@ def example_no_auth(self):
},
],
'no_auth': [
{
'method': 'GET',
'path': '/no_auth_deprecated',
'summary': 'Example No Auth Deprecated',
},
{
'method': 'GET',
'path': '/no_auth',
Expand Down
Loading