64af753aab
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 15s
CI / build (pull_request) Successful in 17s
CI / quality (pull_request) Successful in 19s
CI / security (pull_request) Successful in 32s
CI / typecheck (pull_request) Successful in 36s
CI / integration_tests (pull_request) Successful in 2m40s
CI / unit_tests (pull_request) Successful in 11m42s
CI / docker (pull_request) Successful in 40s
CI / benchmark-regression (pull_request) Successful in 21m35s
CI / coverage (pull_request) Successful in 45m10s
CI / lint (push) Successful in 12s
CI / quality (push) Successful in 18s
CI / build (push) Successful in 23s
CI / security (push) Successful in 32s
CI / typecheck (push) Successful in 57s
CI / benchmark-regression (push) Has been skipped
CI / integration_tests (push) Successful in 2m43s
CI / unit_tests (push) Successful in 12m13s
CI / benchmark-publish (push) Successful in 12m19s
CI / docker (push) Successful in 1m2s
CI / coverage (push) Successful in 1h26m6s
Implemented namespace/project/plan/skill permission model with role bindings (owner/admin/editor/viewer) and default deny policy. Added enforcement hooks at CLI/service boundaries that are server-only; local mode returns permissive defaults. Includes role enums, permission check service, role matrix documentation. Includes Behave BDD scenarios, Robot integration tests, ASV benchmarks, and reference documentation. ISSUES CLOSED: #344
130 lines
5.5 KiB
Plaintext
130 lines
5.5 KiB
Plaintext
*** Settings ***
|
|
Documentation Permission system integration tests — role-based access control
|
|
Library OperatingSystem
|
|
Library Collections
|
|
Library String
|
|
Library Process
|
|
Library helper_permission_system.py
|
|
Resource ${CURDIR}/common.resource
|
|
|
|
*** Variables ***
|
|
${SRC_DIR} ${CURDIR}/../src/cleveragents
|
|
|
|
*** Test Cases ***
|
|
Permission Module Exists
|
|
[Documentation] Verify the permission domain model module is present
|
|
File Should Exist ${SRC_DIR}/domain/models/core/permission.py
|
|
|
|
Permission Service Module Exists
|
|
[Documentation] Verify the permission service module is present
|
|
File Should Exist ${SRC_DIR}/application/services/permission_service.py
|
|
|
|
Permission Module Exports Expected Enums
|
|
[Documentation] Verify permission.py exports public enums
|
|
${content}= Get File ${SRC_DIR}/domain/models/core/permission.py
|
|
Should Contain ${content} class PermissionRole
|
|
Should Contain ${content} class PermissionScope
|
|
Should Contain ${content} class PermissionAction
|
|
|
|
Permission Module Exports Models
|
|
[Documentation] Verify permission.py exports data models
|
|
${content}= Get File ${SRC_DIR}/domain/models/core/permission.py
|
|
Should Contain ${content} class RoleBinding
|
|
Should Contain ${content} class PermissionCheck
|
|
Should Contain ${content} class PermissionPolicy
|
|
|
|
Permission Module Exports Constants
|
|
[Documentation] Verify permission.py exports constant mappings
|
|
${content}= Get File ${SRC_DIR}/domain/models/core/permission.py
|
|
Should Contain ${content} ROLE_PERMISSIONS
|
|
Should Contain ${content} DEFAULT_LOCAL_ROLE_MAPPING
|
|
|
|
Service Module Exports Expected Symbols
|
|
[Documentation] Verify permission_service.py exports public API
|
|
${content}= Get File ${SRC_DIR}/application/services/permission_service.py
|
|
Should Contain ${content} class PermissionService
|
|
Should Contain ${content} def check_permission
|
|
Should Contain ${content} def enforce_permission
|
|
Should Contain ${content} def is_local_mode
|
|
Should Contain ${content} def get_role_bindings
|
|
|
|
Core Init Exports Permission Models
|
|
[Documentation] Verify core __init__.py re-exports permission types
|
|
${content}= Get File ${SRC_DIR}/domain/models/core/__init__.py
|
|
Should Contain ${content} PermissionRole
|
|
Should Contain ${content} PermissionScope
|
|
Should Contain ${content} PermissionAction
|
|
Should Contain ${content} RoleBinding
|
|
Should Contain ${content} PermissionCheck
|
|
Should Contain ${content} PermissionPolicy
|
|
Should Contain ${content} ROLE_PERMISSIONS
|
|
Should Contain ${content} DEFAULT_LOCAL_ROLE_MAPPING
|
|
|
|
Services Init Exports Permission Service
|
|
[Documentation] Verify services __init__.py re-exports PermissionService
|
|
${content}= Get File ${SRC_DIR}/application/services/__init__.py
|
|
Should Contain ${content} PermissionService
|
|
Should Contain ${content} enforce_permission
|
|
|
|
Permission Role Enum Values Via Python
|
|
[Documentation] Verify PermissionRole values using helper
|
|
@{roles}= Get Permission Roles
|
|
Should Contain ${roles} owner
|
|
Should Contain ${roles} admin
|
|
Should Contain ${roles} editor
|
|
Should Contain ${roles} viewer
|
|
Length Should Be ${roles} 4
|
|
|
|
Permission Scope Enum Values Via Python
|
|
[Documentation] Verify PermissionScope values using helper
|
|
@{scopes}= Get Permission Scopes
|
|
Should Contain ${scopes} namespace
|
|
Should Contain ${scopes} project
|
|
Should Contain ${scopes} plan
|
|
Should Contain ${scopes} skill
|
|
Length Should Be ${scopes} 4
|
|
|
|
Permission Action Enum Values Via Python
|
|
[Documentation] Verify PermissionAction values using helper
|
|
@{actions}= Get Permission Actions
|
|
Should Contain ${actions} read
|
|
Should Contain ${actions} write
|
|
Should Contain ${actions} execute
|
|
Should Contain ${actions} delete
|
|
Should Contain ${actions} admin
|
|
Length Should Be ${actions} 5
|
|
|
|
Local Mode Permission Check Via Python
|
|
[Documentation] Verify local mode always permits
|
|
${result}= Check Permission Local Mode alice write project proj-1
|
|
Should Be True ${result}
|
|
|
|
Server Mode Denied Without Binding Via Python
|
|
[Documentation] Verify server mode denies without bindings
|
|
${result}= Check Permission Server No Bindings alice write project proj-1
|
|
Should Not Be True ${result}
|
|
|
|
Server Mode Allows With Binding Via Python
|
|
[Documentation] Verify server mode allows when binding exists
|
|
${result}= Check Permission Server With Binding alice editor read project proj-1
|
|
Should Be True ${result}
|
|
|
|
Owner Role Has All Actions Via Python
|
|
[Documentation] Verify OWNER role maps to all 5 actions
|
|
${count}= Get Role Action Count owner
|
|
Should Be Equal As Integers ${count} 5
|
|
|
|
Viewer Role Has Only Read Via Python
|
|
[Documentation] Verify VIEWER role maps to 1 action
|
|
${count}= Get Role Action Count viewer
|
|
Should Be Equal As Integers ${count} 1
|
|
|
|
Default Local Role Mapping Via Python
|
|
[Documentation] Verify wildcard maps to owner
|
|
${role}= Get Default Local Role
|
|
Should Be Equal ${role} owner
|
|
|
|
Documentation File Exists
|
|
[Documentation] Verify reference documentation was created
|
|
File Should Exist ${CURDIR}/../docs/reference/permissions.md
|