2021-02-08 05:05:17 +00:00
|
|
|
*** Settings ***
|
2021-12-09 10:58:51 +00:00
|
|
|
Variables common.py
|
2021-09-10 12:44:40 +00:00
|
|
|
|
2022-05-17 13:54:57 +00:00
|
|
|
Library acl.py
|
|
|
|
Library container.py
|
2022-03-15 11:58:59 +00:00
|
|
|
Library neofs_verbs.py
|
2022-05-19 14:07:27 +00:00
|
|
|
Library utility_keywords.py
|
2021-06-01 12:07:31 +00:00
|
|
|
|
2021-12-09 10:58:51 +00:00
|
|
|
Resource eacl_tables.robot
|
|
|
|
Resource payment_operations.robot
|
|
|
|
Resource setup_teardown.robot
|
2021-02-08 05:05:17 +00:00
|
|
|
|
2022-03-15 11:58:59 +00:00
|
|
|
*** Variables ***
|
|
|
|
&{USER_HEADER} = key1=1 key2=abc
|
|
|
|
&{USER_HEADER_DEL} = key1=del key2=del
|
|
|
|
&{ANOTHER_HEADER} = key1=oth key2=oth
|
2021-02-08 05:05:17 +00:00
|
|
|
|
|
|
|
*** Test cases ***
|
|
|
|
BearerToken Operations
|
|
|
|
[Documentation] Testcase to validate NeoFS operations with BearerToken.
|
2022-03-15 11:58:59 +00:00
|
|
|
[Tags] ACL BearerToken
|
2021-02-08 05:05:17 +00:00
|
|
|
[Timeout] 20 min
|
|
|
|
|
2021-04-26 10:30:40 +00:00
|
|
|
|
2022-02-01 13:42:41 +00:00
|
|
|
${WALLET} ${_} ${_} = Prepare Wallet And Deposit
|
2021-04-26 10:30:40 +00:00
|
|
|
|
2021-02-08 05:05:17 +00:00
|
|
|
Log Check Bearer token with simple object
|
2022-05-19 14:07:27 +00:00
|
|
|
${FILE_S} ${_} = Generate file ${SIMPLE_OBJ_SIZE}
|
2022-02-01 13:42:41 +00:00
|
|
|
Check eACL Deny and Allow All Bearer ${WALLET} ${FILE_S}
|
2021-04-26 10:30:40 +00:00
|
|
|
|
2021-02-08 05:05:17 +00:00
|
|
|
Log Check Bearer token with complex object
|
2022-05-19 14:07:27 +00:00
|
|
|
${FILE_S} ${_} = Generate file ${COMPLEX_OBJ_SIZE}
|
2022-02-01 13:42:41 +00:00
|
|
|
Check eACL Deny and Allow All Bearer ${WALLET} ${FILE_S}
|
2021-04-26 10:30:40 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
2021-02-16 11:56:52 +00:00
|
|
|
|
2021-02-08 05:05:17 +00:00
|
|
|
|
|
|
|
*** Keywords ***
|
2021-04-26 10:30:40 +00:00
|
|
|
|
2021-02-08 05:05:17 +00:00
|
|
|
Check eACL Deny and Allow All Bearer
|
2022-02-01 13:42:41 +00:00
|
|
|
[Arguments] ${WALLET} ${FILE_S}
|
2021-04-02 14:29:41 +00:00
|
|
|
|
2022-05-17 13:54:57 +00:00
|
|
|
${CID} = Create Container ${WALLET} basic_acl=eacl-public-read-write
|
2022-02-01 13:42:41 +00:00
|
|
|
${S_OID_USER} = Put object ${WALLET} ${FILE_S} ${CID} user_headers=${USER_HEADER}
|
|
|
|
${D_OID_USER} = Put object ${WALLET} ${FILE_S} ${CID} user_headers=${USER_HEADER_DEL}
|
|
|
|
@{S_OBJ_H} = Create List ${S_OID_USER}
|
2021-09-10 12:44:40 +00:00
|
|
|
|
2022-02-01 13:42:41 +00:00
|
|
|
Put object ${WALLET} ${FILE_S} ${CID} user_headers=${ANOTHER_HEADER}
|
|
|
|
Get object ${WALLET} ${CID} ${S_OID_USER} ${EMPTY} local_file_eacl
|
|
|
|
Search object ${WALLET} ${CID} ${EMPTY} ${EMPTY} ${USER_HEADER} ${S_OBJ_H}
|
|
|
|
Head object ${WALLET} ${CID} ${S_OID_USER}
|
2022-08-02 15:47:10 +00:00
|
|
|
Get Range ${WALLET} ${CID} ${S_OID_USER} 0:256
|
2022-02-01 13:42:41 +00:00
|
|
|
Delete object ${WALLET} ${CID} ${D_OID_USER}
|
2021-09-10 12:44:40 +00:00
|
|
|
|
2022-02-01 13:42:41 +00:00
|
|
|
Set eACL ${WALLET} ${CID} ${EACL_DENY_ALL_USER}
|
2021-09-10 12:44:40 +00:00
|
|
|
|
|
|
|
# The current ACL cache lifetime is 30 sec
|
|
|
|
Sleep ${NEOFS_CONTRACT_CACHE_TIMEOUT}
|
|
|
|
|
|
|
|
${rule1}= Create Dictionary Operation=GET Access=ALLOW Role=USER
|
|
|
|
${rule2}= Create Dictionary Operation=HEAD Access=ALLOW Role=USER
|
|
|
|
${rule3}= Create Dictionary Operation=PUT Access=ALLOW Role=USER
|
|
|
|
${rule4}= Create Dictionary Operation=DELETE Access=ALLOW Role=USER
|
|
|
|
${rule5}= Create Dictionary Operation=SEARCH Access=ALLOW Role=USER
|
|
|
|
${rule6}= Create Dictionary Operation=GETRANGE Access=ALLOW Role=USER
|
|
|
|
${rule7}= Create Dictionary Operation=GETRANGEHASH Access=ALLOW Role=USER
|
|
|
|
|
|
|
|
${eACL_gen}= Create List ${rule1} ${rule2} ${rule3} ${rule4} ${rule5} ${rule6} ${rule7}
|
|
|
|
|
2022-02-01 13:42:41 +00:00
|
|
|
${EACL_TOKEN} = Form BearerToken File ${WALLET} ${CID} ${eACL_gen}
|
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}
|
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} ${EMPTY} local_file_eacl
|
2021-09-10 12:44:40 +00:00
|
|
|
Run Keyword And Expect Error *
|
2022-02-01 13:42:41 +00:00
|
|
|
... Search object ${WALLET} ${CID} ${EMPTY} ${EMPTY} ${USER_HEADER} ${S_OBJ_H}
|
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}
|
2021-09-10 12:44:40 +00:00
|
|
|
Run Keyword And Expect Error *
|
2022-08-02 15:47:10 +00:00
|
|
|
... Get Range ${WALLET} ${CID} ${S_OID_USER} 0:256
|
2021-09-10 12:44:40 +00:00
|
|
|
Run Keyword And Expect Error *
|
2022-02-01 13:42:41 +00:00
|
|
|
... Delete object ${WALLET} ${CID} ${S_OID_USER}
|
2021-09-10 12:44:40 +00:00
|
|
|
|
|
|
|
# All operations on object should be passed with bearer token
|
2022-02-01 13:42:41 +00:00
|
|
|
Put object ${WALLET} ${FILE_S} ${CID} bearer=${EACL_TOKEN}
|
|
|
|
Get object ${WALLET} ${CID} ${S_OID_USER} ${EACL_TOKEN} local_file_eacl
|
|
|
|
Search object ${WALLET} ${CID} ${EMPTY} ${EACL_TOKEN} ${USER_HEADER} ${S_OBJ_H}
|
|
|
|
Head object ${WALLET} ${CID} ${S_OID_USER} bearer_token=${EACL_TOKEN}
|
2022-08-02 15:47:10 +00:00
|
|
|
Get Range ${WALLET} ${CID} ${S_OID_USER} 0:256 bearer=${EACL_TOKEN}
|
2022-02-01 13:42:41 +00:00
|
|
|
Delete object ${WALLET} ${CID} ${S_OID_USER} bearer=${EACL_TOKEN}
|