Compare commits

..

6 Commits

Author SHA1 Message Date
d95fec7132 [test] oidc through iframe 2025-01-09 13:59:06 +00:00
zhuboxiang
718cfe2b36 Change to use shell cat to fetch commit_id
Command file can not do correct when run it on centos 7
with docker to build. So Change it to use shell cat.

Change-Id: I1186b22c224bbc6e828f71014f5b7f920df3a651
(cherry picked from commit 2a3a08e328)
2024-07-10 02:41:17 +00:00
zhuboxiang
9b85645aab fix: Set stable-2024.1 version of skyline-console to use
1. Use version of stable-2024.1 for skyline-console package
2. Set docker image tag as 2024.1

Change-Id: Ifedbefe00f6f7d52393fef507f31ddcaf1d122b9
2024-07-02 14:02:18 +08:00
Michal Arbet
c7195d5bcb Fix skyline-apiserver on python3.11
Bump pydantic version which fixes skyline-apiserver
when running under python3.11.

Closes-Bug: #2047145
Change-Id: Idb1897f64ffaf0cd0fbee4f7f198935386a5f599
(cherry picked from commit eea81cef1e)
2024-06-21 18:15:35 +02:00
OpenStack Release Bot
b18edc14c0 Update TOX_CONSTRAINTS_FILE for stable/2024.1
Update the URL to the upper-constraints file to point to the redirect
rule on releases.openstack.org so that anyone working on this branch
will switch to the correct upper-constraints list automatically when
the requirements repository branches.

Until the requirements repository has as stable/2024.1 branch, tests will
continue to use the upper-constraints list on master.

Change-Id: I99531dd8dab86694f3b836cdef1ef48a65a95b27
2024-03-15 14:21:23 +00:00
OpenStack Release Bot
c5a20b98e4 Update .gitreview for stable/2024.1
Change-Id: Idb6dcf86c5e071c811b1166923f711731351aabb
2024-03-15 14:21:21 +00:00
15 changed files with 69 additions and 47 deletions

View File

@ -2,4 +2,4 @@
host=review.opendev.org
port=29418
project=openstack/skyline-apiserver.git
defaultbranch=master
defaultbranch=stable/2024.1

View File

@ -25,13 +25,40 @@
tox_install_siblings: false
tox_envlist: functional
- job:
name: skyline-tox-py38
parent: openstack-tox-py38
description: |
Skyline py38 unittest tests
vars:
python_version: 3.8
tox_envlist: py38
- job:
name: skyline-tox-pep8-py38
parent: openstack-tox-py38
description: |
Skyline code static analysis
vars:
python_version: 3.8
tox_envlist: pep8
- project:
templates:
- openstack-python3-jobs
- release-notes-jobs-python3
- publish-openstack-docs-pti
check:
jobs:
- skyline-tox-py38:
irrelevant-files:
- ^container/.*$
- ^devstack/.*$
- ^docs/.*$
- ^tools/.*$
- ^.*\.rst$
- ^.*\.md$
- ^kolla/.*$
- skyline-tox-pep8-py38
- skyline-functional-devstack:
irrelevant-files:
- ^container/.*$
@ -44,6 +71,16 @@
- ^releasenotes/.*$
gate:
jobs:
- skyline-tox-py38:
irrelevant-files:
- ^container/.*$
- ^devstack/.*$
- ^docs/.*$
- ^tools/.*$
- ^.*\.rst$
- ^.*\.md$
- ^kolla/.*$
- skyline-tox-pep8-py38
- skyline-functional-devstack:
irrelevant-files:
- ^container/.*$

View File

@ -17,7 +17,7 @@ GIT_BRANCH ?= $(shell git rev-parse --abbrev-ref HEAD)
GIT_COMMIT ?= $(shell git rev-parse --verify HEAD)
# URL for skyline-console packages
SKYLINE_CONSOLE_PACKAGE_URL ?= "https://tarballs.opendev.org/openstack/skyline-console/skyline-console-master.tar.gz"
SKYLINE_CONSOLE_PACKAGE_URL ?= "https://tarballs.opendev.org/openstack/skyline-console/skyline-console-stable-2024.1.tar.gz"
.PHONY: help
@ -81,7 +81,7 @@ BUILD_ENGINE ?= docker
BUILD_CONTEXT ?= .
DOCKER_FILE ?= container/Dockerfile
IMAGE ?= skyline
IMAGE_TAG ?= latest
IMAGE_TAG ?= 2024.1
ifeq ($(BUILD_ENGINE), docker)
build_cmd = docker build
else ifeq ($(BUILD_ENGINE), buildah)

View File

@ -25,12 +25,12 @@ RUN pip install -U /opt/skyline_apiserver/skyline_console/skyline_console.tar.gz
COPY ./requirements.txt /opt/skyline_apiserver/requirements.txt
RUN pip install -r /opt/skyline_apiserver/requirements.txt -chttps://releases.openstack.org/constraints/upper/master
RUN pip install -r /opt/skyline_apiserver/requirements.txt -chttps://releases.openstack.org/constraints/upper/2024.1
COPY ./ /opt/skyline_apiserver/
RUN git init /opt/skyline_apiserver \
&& pip install /opt/skyline_apiserver -chttps://releases.openstack.org/constraints/upper/master \
&& pip install /opt/skyline_apiserver -chttps://releases.openstack.org/constraints/upper/2024.1 \
&& apt-get clean \
&& rm -rf ~/.cache/pip \
&& mkdir -p /etc/skyline /var/log/skyline /var/lib/skyline

View File

@ -1,6 +0,0 @@
===========================
2024.1 Series Release Notes
===========================
.. release-notes::
:branch: stable/2024.1

View File

@ -1,6 +0,0 @@
===========================
2024.2 Series Release Notes
===========================
.. release-notes::
:branch: stable/2024.2

View File

@ -6,8 +6,6 @@ Skyline APIServer Release Notes
:maxdepth: 1
unreleased
2024.2
2024.1
2023.2
2023.1
zed

View File

@ -3,4 +3,4 @@ Zed Series Release Notes
========================
.. release-notes::
:branch: unmaintained/zed
:branch: stable/zed

View File

@ -4,8 +4,8 @@ pydantic<=1.10.0 # MIT
uvicorn<=0.17.6 # BSD License (3 clause)
gunicorn>=20.1.0 # MIT
python-jose<=3.3.0 # MIT
databases>=0.9.0 # BSD License (3 clause)
aiomysql>=0.2.0 # MIT
databases<=0.8.0 # BSD License (3 clause)
aiomysql<=0.1.1 # MIT
aiosqlite<=0.17.0 # MIT
loguru<=0.5.3 # MIT
PyYAML>=5.4.1 # MIT

View File

@ -173,10 +173,9 @@ async def login(
regex=constants.INBOUND_HEADER_REGEX,
),
) -> schemas.Profile:
region = credential.region or CONF.openstack.default_region
try:
project_scope, unscope_token, default_project_id = await _get_projects_and_unscope_token(
region=region,
region=credential.region,
domain=credential.domain,
username=credential.username,
password=credential.password,
@ -187,13 +186,13 @@ async def login(
default_project_id = None
project_scope_token = await get_project_scope_token(
keystone_token=unscope_token,
region=region,
region=credential.region,
project_id=default_project_id or project_scope[0].id,
)
profile = await generate_profile(
keystone_token=project_scope_token,
region=region,
region=credential.region,
)
profile = await _patch_profile(profile, x_openstack_request_id)
@ -301,8 +300,8 @@ async def websso(
)
else:
response = RedirectResponse(url="/base/overview", status_code=status.HTTP_302_FOUND)
response.set_cookie(CONF.default.session_name, profile.toJWTPayload())
response.set_cookie(constants.TIME_EXPIRED_KEY, str(profile.exp))
response.set_cookie(CONF.default.session_name, profile.toJWTPayload(),secure=True,samesite="None")
response.set_cookie(constants.TIME_EXPIRED_KEY, str(profile.exp),secure=True,samesite="None")
return response

View File

@ -16,9 +16,9 @@ from __future__ import annotations
import time
from functools import wraps
from typing import Any, Union
from typing import Any
from sqlalchemy import Insert, Update, delete, func, insert, select, update
from sqlalchemy import delete, func, insert, select, update
from skyline_apiserver.types import Fn
@ -41,7 +41,7 @@ def check_db_connected(fn: Fn) -> Any:
async def check_token(token_id: str) -> bool:
count_label = "revoked_count"
query = (
select(func.count(RevokedToken.c.uuid).label(count_label))
select([func.count(RevokedToken.c.uuid).label(count_label)])
.select_from(RevokedToken)
.where(RevokedToken.c.uuid == token_id)
)
@ -76,7 +76,7 @@ async def purge_revoked_token() -> Any:
@check_db_connected
async def list_settings() -> Any:
query = select(Settings)
query = select([Settings])
db = DB.get()
async with db.transaction():
result = await db.fetch_all(query)
@ -86,7 +86,7 @@ async def list_settings() -> Any:
@check_db_connected
async def get_setting(key: str) -> Any:
query = select(Settings).where(Settings.c.key == key)
query = select([Settings]).where(Settings.c.key == key)
db = DB.get()
async with db.transaction():
result = await db.fetch_one(query)
@ -97,17 +97,17 @@ async def get_setting(key: str) -> Any:
@check_db_connected
async def update_setting(key: str, value: Any) -> Any:
get_query = (
select(Settings.c.key, Settings.c.value).where(Settings.c.key == key).with_for_update()
select([Settings.c.key, Settings.c.value]).where(Settings.c.key == key).with_for_update()
)
db = DB.get()
async with db.transaction():
is_exist = await db.fetch_one(get_query)
stmt: Union[Insert, Update]
if is_exist is None:
stmt = insert(Settings).values(key=key, value=value)
query = insert(Settings)
await db.execute(query, {"key": key, "value": value})
else:
stmt = update(Settings).where(Settings.c.key == key).values(value=value)
await db.execute(stmt)
query = update(Settings).where(Settings.c.key == key)
await db.execute(query, {"value": value})
result = await db.fetch_one(get_query)
return result

View File

@ -42,7 +42,8 @@ async def on_startup() -> None:
if CONF.default.cors_allow_origins:
app.add_middleware(
CORSMiddleware,
allow_origins=[str(origin) for origin in CONF.default.cors_allow_origins],
allow_origins=[
str(origin) for origin in CONF.default.cors_allow_origins] + ['https://demo.felcloud.io', 'https://baha-dev.felcloud.io'],
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],

View File

@ -24,7 +24,7 @@ from skyline_apiserver.types import constants
class Credential(BaseModel):
region: Optional[str] = Field(None, description="Credential identity service region")
region: str = Field(..., description="Credential user region")
domain: str = Field(..., description="Credential user domain")
username: str = Field(..., description="Credential username")
password: str = Field(..., description="Credential password for user")

View File

@ -2229,6 +2229,7 @@
"Credential": {
"title": "Credential",
"required": [
"region",
"domain",
"username",
"password"
@ -2238,7 +2239,7 @@
"region": {
"title": "Region",
"type": "string",
"description": "Credential identity service region"
"description": "Credential user region"
},
"domain": {
"title": "Domain",

View File

@ -14,8 +14,8 @@ setenv =
OS_STDOUT_CAPTURE=1
OS_STDERR_CAPTURE=1
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/2024.1}
-r{toxinidir}/requirements.txt
-r{toxinidir}/test-requirements.txt
@ -77,7 +77,7 @@ commands =
[testenv:docs]
deps =
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/2024.1}
-r{toxinidir}/requirements.txt
-r{toxinidir}/doc/requirements.txt
commands =
@ -106,7 +106,6 @@ commands =
description =
Generate swagger files.
envdir = {toxworkdir}/shared
allowlist_externals = skyline-swagger-generator
commands =
skyline-swagger-generator -o swagger.json
@ -114,7 +113,6 @@ commands =
description =
Generate config files.
envdir = {toxworkdir}/shared
allowlist_externals = skyline-sample-config-generator
commands =
skyline-sample-config-generator -o etc/skyline.yaml.sample