2021-02-08 05:05:17 +00:00
|
|
|
*** Settings ***
|
2021-12-09 10:58:51 +00:00
|
|
|
Variables common.py
|
2021-02-08 05:05:17 +00:00
|
|
|
|
|
|
|
Library Collections
|
2021-09-10 12:44:40 +00:00
|
|
|
Library acl.py
|
2022-05-17 13:54:57 +00:00
|
|
|
Library container.py
|
2021-09-10 12:44:40 +00:00
|
|
|
Library neofs.py
|
2022-03-15 11:58:59 +00:00
|
|
|
Library neofs_verbs.py
|
2021-09-10 12:44:40 +00:00
|
|
|
Library payment_neogo.py
|
2021-06-01 12:07:31 +00:00
|
|
|
|
2021-12-09 10:58:51 +00:00
|
|
|
Resource eacl_tables.robot
|
2021-02-08 05:05:17 +00:00
|
|
|
Resource common_steps_acl_bearer.robot
|
2021-12-09 10:58:51 +00:00
|
|
|
Resource payment_operations.robot
|
|
|
|
Resource setup_teardown.robot
|
2021-02-08 05:05:17 +00:00
|
|
|
|
2021-06-30 21:18:37 +00:00
|
|
|
*** Variables ***
|
|
|
|
${SYSTEM_KEY} = ${NEOFS_IR_WIF}
|
2022-03-15 11:58:59 +00:00
|
|
|
&{USER_HEADER} = key1=1 key2=abc
|
|
|
|
&{ANOTHER_HEADER} = key1=oth key2=oth
|
2021-06-30 21:18:37 +00:00
|
|
|
|
2021-02-08 05:05:17 +00:00
|
|
|
*** Test cases ***
|
|
|
|
BearerToken Operations for Сompound Operations
|
2021-12-16 06:51:26 +00:00
|
|
|
[Documentation] Testcase to validate NeoFS operations with BearerToken for Сompound Operations.
|
2022-03-15 11:58:59 +00:00
|
|
|
[Tags] ACL BearerToken
|
2021-12-16 06:51:26 +00:00
|
|
|
[Timeout] 20 min
|
2021-02-08 05:05:17 +00:00
|
|
|
|
2021-12-16 06:51:26 +00:00
|
|
|
[Setup] Setup
|
2022-03-15 11:58:59 +00:00
|
|
|
|
2022-02-01 13:42:41 +00:00
|
|
|
${WALLET} ${_} ${_} = Prepare Wallet And Deposit
|
|
|
|
${WALLET_OTH} ${_} ${_} = Prepare Wallet And Deposit
|
2021-04-26 10:30:40 +00:00
|
|
|
|
2021-12-16 06:51:26 +00:00
|
|
|
Log Check Bearer token with simple object
|
|
|
|
${FILE_S} = Generate file ${SIMPLE_OBJ_SIZE}
|
2022-02-01 13:42:41 +00:00
|
|
|
Check Сompound Operations ${WALLET} ${WALLET_OTH} ${FILE_S}
|
2021-02-08 05:05:17 +00:00
|
|
|
|
2021-12-16 06:51:26 +00:00
|
|
|
Log Check Bearer token with complex object
|
|
|
|
${FILE_S} = Generate file ${COMPLEX_OBJ_SIZE}
|
2022-02-01 13:42:41 +00:00
|
|
|
Check Сompound Operations ${WALLET} ${WALLET_OTH} ${FILE_S}
|
2021-02-08 05:05:17 +00:00
|
|
|
|
2021-12-16 06:51:26 +00:00
|
|
|
[Teardown] Teardown acl_bearer_compound
|
2021-04-26 10:30:40 +00:00
|
|
|
|
|
|
|
|
2021-02-08 05:05:17 +00:00
|
|
|
*** Keywords ***
|
|
|
|
|
|
|
|
Check Сompound Operations
|
2022-02-01 13:42:41 +00:00
|
|
|
[Arguments] ${USER_WALLET} ${OTHER_WALLET} ${FILE_S}
|
|
|
|
|
|
|
|
${WALLET_SYS} ${ADDR_SYS} = Prepare Wallet with WIF And Deposit ${SYSTEM_KEY}
|
|
|
|
|
|
|
|
Check Bearer Сompound Get ${OTHER_WALLET} OTHERS ${EACL_DENY_ALL_OTHERS} ${FILE_S} ${USER_WALLET} ${WALLET_SYS}
|
|
|
|
Check Bearer Сompound Get ${USER_WALLET} USER ${EACL_DENY_ALL_USER} ${FILE_S} ${USER_WALLET} ${WALLET_SYS}
|
|
|
|
Check Bearer Сompound Get ${WALLET_SYS} SYSTEM ${EACL_DENY_ALL_SYSTEM} ${FILE_S} ${USER_WALLET} ${WALLET_SYS}
|
|
|
|
|
|
|
|
Check Bearer Сompound Delete ${OTHER_WALLET} OTHERS ${EACL_DENY_ALL_OTHERS} ${FILE_S} ${USER_WALLET} ${WALLET_SYS}
|
|
|
|
Check Bearer Сompound Delete ${USER_WALLET} USER ${EACL_DENY_ALL_USER} ${FILE_S} ${USER_WALLET} ${WALLET_SYS}
|
|
|
|
Check Bearer Сompound Delete ${WALLET_SYS} SYSTEM ${EACL_DENY_ALL_SYSTEM} ${FILE_S} ${USER_WALLET} ${WALLET_SYS}
|
|
|
|
|
2022-05-17 13:54:57 +00:00
|
|
|
Check Bearer Сompound Get Range Hash ${OTHER_WALLET} OTHERS ${EACL_DENY_ALL_OTHERS} ${USER_WALLET} ${FILE_S} ${WALLET_SYS}
|
2022-02-01 13:42:41 +00:00
|
|
|
Check Bearer Сompound Get Range Hash ${USER_WALLET} USER ${EACL_DENY_ALL_USER} ${USER_WALLET} ${FILE_S} ${WALLET_SYS}
|
|
|
|
Check Bearer Сompound Get Range Hash ${WALLET_SYS} SYSTEM ${EACL_DENY_ALL_SYSTEM} ${USER_WALLET} ${FILE_S} ${WALLET_SYS}
|
2021-02-08 05:05:17 +00:00
|
|
|
Check Bearer Сompound Get
|
2022-02-01 13:42:41 +00:00
|
|
|
[Arguments] ${WALLET} ${DENY_GROUP} ${DENY_EACL} ${FILE_S} ${USER_WALLET} ${WALLET_SYS}
|
2021-02-08 05:05:17 +00:00
|
|
|
|
2022-05-17 13:54:57 +00:00
|
|
|
${CID} = Create Container ${USER_WALLET} basic_acl=eacl-public-read-write
|
2022-02-17 09:52:48 +00:00
|
|
|
Prepare eACL Role rules ${CID}
|
2022-02-01 13:42:41 +00:00
|
|
|
${S_OID_USER} = Put object ${USER_WALLET} ${FILE_S} ${CID} user_headers=${USER_HEADER}
|
2022-03-15 11:58:59 +00:00
|
|
|
@{S_OBJ_H} = Create List ${S_OID_USER}
|
2021-02-08 05:05:17 +00:00
|
|
|
|
2022-02-01 13:42:41 +00:00
|
|
|
${S_OID_USER} = Put object ${USER_WALLET} ${FILE_S} ${CID} user_headers=${USER_HEADER}
|
|
|
|
Put object ${WALLET} ${FILE_S} ${CID} user_headers=${ANOTHER_HEADER}
|
|
|
|
Get object ${WALLET} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl
|
|
|
|
Set eACL ${USER_WALLET} ${CID} ${DENY_EACL}
|
2021-04-26 10:30:40 +00:00
|
|
|
|
2021-09-10 12:44:40 +00:00
|
|
|
# The current ACL cache lifetime is 30 sec
|
|
|
|
Sleep ${NEOFS_CONTRACT_CACHE_TIMEOUT}
|
2021-04-02 14:29:41 +00:00
|
|
|
|
2021-09-10 12:44:40 +00:00
|
|
|
${rule1}= Create Dictionary Operation=GET Access=ALLOW Role=${DENY_GROUP}
|
|
|
|
${rule2}= Create Dictionary Operation=GETRANGE Access=ALLOW Role=${DENY_GROUP}
|
|
|
|
${rule3}= Create Dictionary Operation=GETRANGEHASH Access=ALLOW Role=${DENY_GROUP}
|
|
|
|
${eACL_gen}= Create List ${rule1} ${rule2} ${rule3}
|
2022-02-01 13:42:41 +00:00
|
|
|
${EACL_TOKEN} = Form BearerToken File ${USER_WALLET} ${CID} ${eACL_gen}
|
2021-02-08 05:05:17 +00:00
|
|
|
|
2021-09-10 12:44:40 +00:00
|
|
|
Run Keyword And Expect Error *
|
2022-02-01 13:42:41 +00:00
|
|
|
... Head object ${WALLET} ${CID} ${S_OID_USER} bearer_token=${EACL_TOKEN}
|
2021-02-08 05:05:17 +00:00
|
|
|
|
2022-02-01 13:42:41 +00:00
|
|
|
Get Object ${WALLET} ${CID} ${S_OID_USER} ${EACL_TOKEN} local_file_eacl
|
|
|
|
IF "${WALLET}" == "${WALLET_SYS}"
|
2021-12-16 06:51:26 +00:00
|
|
|
Run Keyword And Expect Error *
|
2022-02-01 13:42:41 +00:00
|
|
|
... Get Range ${WALLET} ${CID} ${S_OID_USER} s_get_range ${EACL_TOKEN} 0:256
|
2022-03-15 11:58:59 +00:00
|
|
|
ELSE
|
2022-02-01 13:42:41 +00:00
|
|
|
Get Range ${WALLET} ${CID} ${S_OID_USER} s_get_range ${EACL_TOKEN} 0:256
|
2021-12-16 06:51:26 +00:00
|
|
|
END
|
2022-02-01 13:42:41 +00:00
|
|
|
Get Range Hash ${WALLET} ${CID} ${S_OID_USER} ${EACL_TOKEN} 0:256
|
2021-02-08 05:05:17 +00:00
|
|
|
|
|
|
|
|
|
|
|
Check Bearer Сompound Delete
|
2022-02-01 13:42:41 +00:00
|
|
|
[Arguments] ${WALLET} ${DENY_GROUP} ${DENY_EACL} ${FILE_S} ${USER_WALLET} ${WALLET_SYS}
|
2021-02-08 05:05:17 +00:00
|
|
|
|
2022-05-17 13:54:57 +00:00
|
|
|
${CID} = Create Container ${USER_WALLET} basic_acl=eacl-public-read-write
|
2022-02-17 09:52:48 +00:00
|
|
|
Prepare eACL Role rules ${CID}
|
2022-02-01 13:42:41 +00:00
|
|
|
${S_OID_USER} = Put object ${USER_WALLET} ${FILE_S} ${CID} user_headers=${USER_HEADER}
|
|
|
|
${D_OID_USER} = Put object ${USER_WALLET} ${FILE_S} ${CID}
|
|
|
|
Put object ${WALLET} ${FILE_S} ${CID} user_headers=${ANOTHER_HEADER}
|
|
|
|
IF "${WALLET}" == "${WALLET_SYS}"
|
2021-12-16 06:51:26 +00:00
|
|
|
Run Keyword And Expect Error *
|
2022-02-01 13:42:41 +00:00
|
|
|
... Delete object ${WALLET} ${CID} ${D_OID_USER} ${EMPTY}
|
2021-12-16 06:51:26 +00:00
|
|
|
ELSE
|
2022-02-01 13:42:41 +00:00
|
|
|
Delete object ${WALLET} ${CID} ${D_OID_USER} ${EMPTY}
|
2021-12-16 06:51:26 +00:00
|
|
|
END
|
2021-04-26 10:30:40 +00:00
|
|
|
|
2022-02-01 13:42:41 +00:00
|
|
|
Set eACL ${USER_WALLET} ${CID} ${DENY_EACL}
|
2021-04-26 10:30:40 +00:00
|
|
|
|
2021-09-10 12:44:40 +00:00
|
|
|
# The current ACL cache lifetime is 30 sec
|
|
|
|
Sleep ${NEOFS_CONTRACT_CACHE_TIMEOUT}
|
2021-04-02 14:29:41 +00:00
|
|
|
|
2021-09-10 12:44:40 +00:00
|
|
|
${rule1} = Create Dictionary Operation=DELETE Access=ALLOW Role=${DENY_GROUP}
|
|
|
|
${rule2} = Create Dictionary Operation=PUT Access=DENY Role=${DENY_GROUP}
|
|
|
|
${rule3} = Create Dictionary Operation=HEAD Access=DENY Role=${DENY_GROUP}
|
|
|
|
${eACL_gen} = Create List ${rule1} ${rule2} ${rule3}
|
2022-02-01 13:42:41 +00:00
|
|
|
${EACL_TOKEN} = Form BearerToken File ${USER_WALLET} ${CID} ${eACL_gen}
|
2021-02-08 05:05:17 +00:00
|
|
|
|
2021-09-10 12:44:40 +00:00
|
|
|
Run Keyword And Expect Error *
|
2022-02-01 13:42:41 +00:00
|
|
|
... Head object ${WALLET} ${CID} ${S_OID_USER} bearer_token=${EACL_TOKEN}
|
2021-09-10 12:44:40 +00:00
|
|
|
Run Keyword And Expect Error *
|
2022-02-01 13:42:41 +00:00
|
|
|
... Put object ${WALLET} ${FILE_S} ${CID} bearer=${EACL_TOKEN} user_headers=${ANOTHER_HEADER}
|
2021-02-08 05:05:17 +00:00
|
|
|
|
2022-02-01 13:42:41 +00:00
|
|
|
Delete object ${USER_WALLET} ${CID} ${S_OID_USER} bearer=${EACL_TOKEN}
|
2021-02-08 05:05:17 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Check Bearer Сompound Get Range Hash
|
2022-02-01 13:42:41 +00:00
|
|
|
[Arguments] ${WALLET} ${DENY_GROUP} ${DENY_EACL} ${USER_WALLET} ${FILE_S} ${WALLET_SYS}
|
2021-02-08 05:05:17 +00:00
|
|
|
|
2022-05-17 13:54:57 +00:00
|
|
|
${CID} = Create Container ${USER_WALLET} basic_acl=eacl-public-read-write
|
2022-02-17 09:52:48 +00:00
|
|
|
Prepare eACL Role rules ${CID}
|
2021-02-08 05:05:17 +00:00
|
|
|
|
2022-05-17 13:54:57 +00:00
|
|
|
${S_OID_USER} = Put object ${USER_WALLET} ${FILE_S} ${CID} user_headers=${USER_HEADER}
|
|
|
|
Put object ${WALLET} ${FILE_S} ${CID} user_headers=${ANOTHER_HEADER}
|
|
|
|
Get Range hash ${WALLET_SYS} ${CID} ${S_OID_USER} ${EMPTY} 0:256
|
|
|
|
Set eACL ${USER_WALLET} ${CID} ${DENY_EACL}
|
2021-04-26 10:30:40 +00:00
|
|
|
|
2021-09-10 12:44:40 +00:00
|
|
|
# The current ACL cache lifetime is 30 sec
|
|
|
|
Sleep ${NEOFS_CONTRACT_CACHE_TIMEOUT}
|
2021-04-02 14:29:41 +00:00
|
|
|
|
2021-09-10 12:44:40 +00:00
|
|
|
${rule1} = Create Dictionary Operation=GETRANGEHASH Access=ALLOW Role=${DENY_GROUP}
|
|
|
|
${rule2} = Create Dictionary Operation=GETRANGE Access=DENY Role=${DENY_GROUP}
|
|
|
|
${rule3} = Create Dictionary Operation=GET Access=DENY Role=${DENY_GROUP}
|
|
|
|
${eACL_gen} = Create List ${rule1} ${rule2} ${rule3}
|
2022-02-01 13:42:41 +00:00
|
|
|
${EACL_TOKEN} = Form BearerToken File ${USER_WALLET} ${CID} ${eACL_gen}
|
2021-02-08 05:05:17 +00:00
|
|
|
|
2021-09-10 12:44:40 +00:00
|
|
|
Run Keyword And Expect Error *
|
2022-02-01 13:42:41 +00:00
|
|
|
... Get Range ${WALLET} ${CID} ${S_OID_USER} s_get_range ${EACL_TOKEN} 0:256
|
2021-09-10 12:44:40 +00:00
|
|
|
Run Keyword And Expect Error *
|
2022-02-01 13:42:41 +00:00
|
|
|
... Get object ${WALLET} ${CID} ${S_OID_USER} ${EACL_TOKEN} local_file_eacl
|
2021-04-26 10:30:40 +00:00
|
|
|
|
2022-02-01 13:42:41 +00:00
|
|
|
Get Range Hash ${WALLET} ${CID} ${S_OID_USER} ${EACL_TOKEN} 0:256
|