Commit Graph

41 Commits

Author SHA1 Message Date
Wu Wenxiang
4e06ed4a5a feat: region field change to optional in login API
region filed default value is CONF.openstack.default_region

Change-Id: I11be6339d5f0d74499f0dd3b28664c27ace43b36
2024-08-21 16:02:00 +08:00
Michal Arbet
eea81cef1e Fix skyline-apiserver on python3.11
Bump pydantic version which fixes skyline-apiserver
when running under python3.11.

Closes-Bug: #2047145
Change-Id: Idb1897f64ffaf0cd0fbee4f7f198935386a5f599
2024-04-08 17:11:16 +08:00
Wenxiang Wu
ce10b6691f fix: user login failure due to no role assignment to its default project
This bug start from: https://review.opendev.org/c/openstack/skyline-apiserver/+/901229

Closes-Bug: #2049719
Change-Id: Icd7dbd5128dc8f4eb83a09d3304726ebb96cb074
2024-01-18 15:51:40 +08:00
Arnaud Morin
51a5b4a483 Use service_type instead of service_name
When retrieving endpoints from keystone catalog, it's better to use
service_type rather than service_name because the name can be arbitrary
(some operator use custom names) while the service_type should always be
consistent.

Change-Id: I966f2d9f40b8306ba645363a4967139f44d6adde
Signed-off-by: Arnaud Morin <arnaud.morin@gmail.com>
2023-12-06 23:13:56 +01:00
Boxiang Zhu
55adae48a5 fix: Use system session to handle
Use system session to handle token data and user

Change-Id: I3b0534c4a5097553e3689fcaf7915c4be6df1fe3
2023-11-20 13:50:55 +08:00
Boxiang Zhu
235f7fb286 feat: Add default_project_id
1. add default_project_id into profile to return
2. if user has default_project_id, then we will login into
this project as default.

Change-Id: I147f7866163ae4d102e83f7c28bbf0077f463974
2023-11-17 18:22:54 +08:00
yangshaoxue
1cedd57d6a fix: fix login API error message
the login API does not return an error message

Change-Id: I76be8ca033effe8da98b6e0f5281561b183b6266
2023-11-02 16:02:06 +08:00
yangshaoxue
1e4f72ca2b Add configurable policy files
Configurable policy files are added for services.

Change-Id: I53549fe80798bdd2e6ed3f92f548ed16393a269f
2023-10-31 13:58:22 +08:00
resitdemir
a2f32fc234 Updating Target Attributes For Barbican Policy
Barbican policy contains target attributes which need to be updated in request context
like "target.secret.project.id". Otherwise certificate menu throws permission denied errors.
Also we need to set "target.secret.read" and "target.secret.read_project_access"
but i did not find a way how to set them.

Change-Id: I51631d0be023fc091b32aaeb71145c2893454bba
2023-09-28 08:15:10 +00:00
Boxiang Zhu
9c4f5e5e74 feat: Add time_expired into cookie
Now the expired time for skyline and keystone is not the same
value. Sometime, when the token of keystone is valid but the
jwt token of skyline-apiserver is invalid.
The skyline-console will send the request to backend service
and then get 401 from skyline.
So we add time_expired into cookie, then skyline-console can
check whether time expired or not.

Change-Id: Id1d3a83eb433c18e88828115e8bd744151fb14f7
2023-06-05 16:40:49 +08:00
Danny Webb
de22d3ba3b change sso port to be optional
request.url.port can return None in the case of default ports (80,443)

Change-Id: I07b5fdf11199afefd2996ff36c6e997e52037308
Signed-off-by: Danny Webb <danny.webb@thehutgroup.com>
2023-04-04 15:27:07 +00:00
yangshaoxue
7f363390c8 fix: prometheus response 500
API /query_range always report 500 error

Bug: 1999839
Change-Id: I66a152c2c76d4984cc2fbf085e8c2d1da3701ece
2022-12-20 11:46:10 +08:00
yangshaoxue
ceabe71b7f feat: Add cafile conf
Add cafile conf and support keystone ssl verify

Change-Id: Id82f49009e2e6778568c629b9fe66e3e50cf73d7
2022-12-15 18:20:49 +08:00
yangsngshaoxue
18b61a1089 fix: Add enforce_new_defaults configuration
Fix barbican policy error

Change-Id: I57ebd29906378a67b5d6fe46ae2c584e0abc2a75
2022-09-16 18:15:29 +08:00
Zuul
00af398d92 Merge "fix: Fix server_name is null in volumes attachment" 2022-08-26 11:51:11 +00:00
Zuul
1730bc5129 Merge "fix: Add enable field in profile" 2022-08-26 07:16:09 +00:00
Boxiang Zhu
71473abbdc fix: Fix server_name is null in volumes attachment
Fix server_name is null in volumes attachment when volume
is attached to server(s).

Change-Id: I69132a2de6c1974e3c081b7cfff0f29b126837bc
2022-08-26 13:42:32 +08:00
yangsngshaoxue
85da8bd976 fix: Add enable field in profile
Add enable field in profile

Change-Id: I1b7b314d49dcd08e8b01be090a7d5206c2f83d4f
2022-08-26 13:14:00 +08:00
Boxiang Zhu
3ccfeefb6c chore: Add description for api params
Add description for api params.

Change-Id: I2f245f52a610dfeb20e8973bcf2b3dec7e000fb8
2022-08-25 17:41:06 +08:00
Boxiang Zhu
f3dacbcea7 chore: Add license for python file and update policy
1. Add license for python file
2. Update the policy for all services

Change-Id: I4bc6a68874afe1cc51da1a24d278165356d5dec3
2022-08-25 14:35:55 +08:00
Zuul
f097842c86 Merge "fix: Check project_id when supply uuid filter" 2022-08-24 12:06:21 +00:00
Zuul
e7809a0002 Merge "refactor: Move all wrapper into wrapper folder" 2022-08-24 11:23:57 +00:00
Zuul
eee3fe81dc Merge "fix: Set bool as string for bootable and multiattach" 2022-08-24 11:23:55 +00:00
Boxiang Zhu
fefc145642 fix: Check project_id when supply uuid filter
Check project_id when supply uuid filter for volume snapshots list.
If project_id is not the same as login project_id when not supply
all_projects, just return None.

Change-Id: Idba709fe5d85087129144aa6bbbfe811fc36359f
2022-08-24 18:30:01 +08:00
Boxiang Zhu
74b29b8c5c refactor: Move all wrapper into wrapper folder
Move all wrapper into wrapper folder

Change-Id: I3f809a15bebdd3284a07acfde4dc887efc0fe36e
2022-08-24 11:54:11 +08:00
Boxiang Zhu
3641286cd5 fix: Set bool as string for bootable and multiattach
Set bool as string for bootable and multiattach query
params.
The cinder client only accept truth value for api as
query params.

Change-Id: Id26a0233c2ffc2d4165e96cab37c62c77fbefb24
2022-08-24 11:21:20 +08:00
yangsngshaoxue
8fadde52bf fix: Fix empty projects in profile
Fix empty projects in profile when using sso login

Change-Id: I2296cc88f04e3a3eeb2c51d8e83335923e0e5353
2022-08-24 10:57:16 +08:00
Boxiang Zhu
40b30101c3 feat: Return both id and name of children volume for snapshots
Return both id and name of children volume for snapshots

Change-Id: I194e13a368d01178b5e4751a42f8f3e6d0faa4f1
2022-08-23 16:41:37 +08:00
Boxiang Zhu
22ea97f536 refactor: Remove invalid codes for volumes and snapshots
The patch: https://review.opendev.org/c/openstack/python-cinderclient/+/767451
has been merged. And it has been released in Xena branch.

So We change the requirements.txt of the python-cinderclient
version as 8.1.0.

Change-Id: Ibf0ddb4c3ea532fdc1bffab210671bf63c128b02
2022-08-23 16:03:38 +08:00
Boxiang Zhu
aa77306945 fix: Fix member use has no snapshot_id filter for volumes
We use system session to filter volumes with snapshot_id.
The snapshot_id filter is non-available for member user.

Change-Id: I6424f117d28378a8eb1dcafa02e6c50029f62015
2022-08-23 15:06:08 +08:00
Boxiang Zhu
7f0a0818f7 feat: Support uuid filter for volume snapshots list
Support uuid filter for volume snapshots list API.

Change-Id: I916fdca140a05f70d8f558e24c92eb2221246ea7
2022-08-23 14:54:36 +08:00
Boxiang Zhu
4b8fed8f63 fix: Fix server_name is null for ports list api
1. Fix server_name is null for ports list api
2. Add more detailed description of params
3. Update swagger.json file

Change-Id: I3f4601235585db3896e7b1d25176b33ff59caf57
2022-08-18 16:20:38 +08:00
Boxiang Zhu
54e67e606c fix: Catch InternalServerError
We need to catch InternalServerError and then LOG. Just
use user_context.

Change-Id: Iaf4aa2d9c7935735bab600aa892f5d90b5800012
2022-08-18 14:49:20 +08:00
Boxiang Zhu
3dd6cb89fc fix: Fix the limit for ports list
We need set retrieve_all as False when we
use neutron client SDK. Default value is True,
it will retrieve all data.

Change-Id: I4e0222c28038fb1b769667951607376adbae284a
2022-08-17 14:57:10 +08:00
yangshaoxue
cbabcbce89 feat: Support SSO login via openID
1. add API sso and websso
2. add sso conf

Implements: blueprint skyline-sso-oid
Change-Id: I352200bb2ebf426adaea71826253730c51eeee03
2022-08-11 17:35:07 +08:00
Boxiang Zhu
88ef320dc6 feat: Support mypy check
1. support mypy check, tox -e mypy or tox -e pep8
2. fix error of mypy check

Change-Id: I41b0013d271f3c7d3a28e1ea6dd0b083893d8983
2022-07-28 16:09:31 +08:00
zhu.boxiang
08c6265d1e feat: Support system scope for policy list and check
1. support system scope for policy list and check
2. add target for check policy api
3. update version of requirements and test-requirements

Change-Id: If251d26bdb522b03a8fb94ae0034d8ca44be5b61
2022-07-18 14:47:12 +08:00
zhu.boxiang
6ca007c1d0 refactor: Refactor the extension schemas
1. remove prefix ext
2. update the swagger file
3. add more detailed info for schemas field

Change-Id: I08f30087e8889d772db3da09a92f1e9390d10dbe
2022-07-14 13:43:52 +08:00
zhu.boxiang
7eaa53c9db refactor: Adjust the common and contrib schemas
1. adjust the common schemas
2. adjust the contrib schemas
3. just use schemas directly because all include in __init__.py
4. update swagger.json file

Change-Id: I4b8c366cbb439fbcb7c118329588eab1b31b9370
2022-07-13 10:16:10 +08:00
zhu.boxiang
32a00a6529 refactor: Register rule and apirule into enforcer
1. We register both apirule and rule into enforcer, so we can keep
the rule in the check_str
2. We re-generate all the services' policy, we just use the original
policy of them. If users want to change, they can change them by
themselves.
3. Adjust the post_install.sh, we install the service packages with
dependencies.
4. Split the ironic and ironic_inspector policy, they can not be in
the same policy file.

Change-Id: I9e152e33be4eef60432fb2030d388b3bec4c082e
2022-06-06 15:03:58 +08:00
zhu.boxiang
8cb60f0833 chore: Move skyline_apiserver out of libs
1. move skyline_apiserver out of libs
2. remove libs folder
3. remove old skyline folder
4. adjust zull, devstack and dockerfile

Change-Id: I27a4babd3df077d1dfc7555f67a6ea618d4b2966
2022-05-18 17:21:00 +08:00