mirror of
https://github.com/GNS3/gns3-server.git
synced 2025-01-25 13:49:46 +00:00
Put user, groups, roles and ACL under /access
This commit is contained in:
parent
a358369606
commit
6ec97a704f
@ -44,25 +44,25 @@ router.include_router(
|
|||||||
|
|
||||||
router.include_router(
|
router.include_router(
|
||||||
users.router,
|
users.router,
|
||||||
prefix="/users",
|
prefix="/access/users",
|
||||||
tags=["Users"]
|
tags=["Users"]
|
||||||
)
|
)
|
||||||
|
|
||||||
router.include_router(
|
router.include_router(
|
||||||
groups.router,
|
groups.router,
|
||||||
prefix="/groups",
|
prefix="/access/groups",
|
||||||
tags=["Users groups"]
|
tags=["Users groups"]
|
||||||
)
|
)
|
||||||
|
|
||||||
router.include_router(
|
router.include_router(
|
||||||
roles.router,
|
roles.router,
|
||||||
prefix="/roles",
|
prefix="/access/roles",
|
||||||
tags=["Roles"]
|
tags=["Roles"]
|
||||||
)
|
)
|
||||||
|
|
||||||
router.include_router(
|
router.include_router(
|
||||||
acl.router,
|
acl.router,
|
||||||
prefix="/acl",
|
prefix="/access/acl",
|
||||||
tags=["ACL"]
|
tags=["ACL"]
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -99,19 +99,19 @@ async def endpoints(
|
|||||||
)
|
)
|
||||||
|
|
||||||
# users
|
# users
|
||||||
add_to_endpoints("/users", "All users", "user")
|
add_to_endpoints("/access/users", "All users", "user")
|
||||||
users = await users_repo.get_users()
|
users = await users_repo.get_users()
|
||||||
for user in users:
|
for user in users:
|
||||||
add_to_endpoints(f"/users/{user.user_id}", f'User "{user.username}"', "user")
|
add_to_endpoints(f"/users/{user.user_id}", f'User "{user.username}"', "user")
|
||||||
|
|
||||||
# groups
|
# groups
|
||||||
add_to_endpoints("/groups", "All groups", "group")
|
add_to_endpoints("/access/groups", "All groups", "group")
|
||||||
groups = await users_repo.get_user_groups()
|
groups = await users_repo.get_user_groups()
|
||||||
for group in groups:
|
for group in groups:
|
||||||
add_to_endpoints(f"/groups/{group.user_group_id}", f'Group "{group.name}"', "group")
|
add_to_endpoints(f"/groups/{group.user_group_id}", f'Group "{group.name}"', "group")
|
||||||
|
|
||||||
# roles
|
# roles
|
||||||
add_to_endpoints("/roles", "All roles", "role")
|
add_to_endpoints("/access/roles", "All roles", "role")
|
||||||
roles = await rbac_repo.get_roles()
|
roles = await rbac_repo.get_roles()
|
||||||
for role in roles:
|
for role in roles:
|
||||||
add_to_endpoints(f"/roles/{role.role_id}", f'Role "{role.name}"', "role")
|
add_to_endpoints(f"/roles/{role.role_id}", f'Role "{role.name}"', "role")
|
||||||
|
@ -62,7 +62,7 @@ class TestACLRoutes:
|
|||||||
rbac_repo = RbacRepository(db_session)
|
rbac_repo = RbacRepository(db_session)
|
||||||
admin_role_id = (await rbac_repo.get_role_by_name("Administrator")).role_id
|
admin_role_id = (await rbac_repo.get_role_by_name("Administrator")).role_id
|
||||||
ace = ACECreate(
|
ace = ACECreate(
|
||||||
path="/acl",
|
path="/access/acl",
|
||||||
ace_type="user",
|
ace_type="user",
|
||||||
user_id=test_user.user_id,
|
user_id=test_user.user_id,
|
||||||
role_id=admin_role_id
|
role_id=admin_role_id
|
||||||
|
@ -29,8 +29,8 @@ ALLOWED_CONTROLLER_ENDPOINTS = [
|
|||||||
("/static/web-ui/{file_path:path}", "GET"),
|
("/static/web-ui/{file_path:path}", "GET"),
|
||||||
("/v3/version", "GET"),
|
("/v3/version", "GET"),
|
||||||
("/v3/version", "POST"),
|
("/v3/version", "POST"),
|
||||||
("/v3/users/login", "POST"),
|
("/v3/access/users/login", "POST"),
|
||||||
("/v3/users/authenticate", "POST"),
|
("/v3/access/users/authenticate", "POST"),
|
||||||
("/v3/symbols", "GET"),
|
("/v3/symbols", "GET"),
|
||||||
("/v3/symbols/{symbol_id:path}/raw", "GET"),
|
("/v3/symbols/{symbol_id:path}/raw", "GET"),
|
||||||
("/v3/symbols/{symbol_id:path}/dimensions", "GET"),
|
("/v3/symbols/{symbol_id:path}/dimensions", "GET"),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user