Fix authmate output when a user creates a box with policies #265

Closed
opened 2025-12-28 17:36:47 +00:00 by sami · 2 comments
Owner

Originally created by @masterSplinter01 on GitHub (Jun 27, 2022).

Originally assigned to: @cthulhu-rider on GitHub.

I tried to create an accessbox using policy example from readme, authmate created a box with correct policy but printed some errors.

$ cat policy.json                                                                                                                                                                                      
{
    "rep-3": "REP 3",
    "complex": "REP 1 IN X CBF 1 SELECT 1 FROM * AS X",
    "example-json-policy": "{\"replicas\":[{\"count\":3,\"selector\":\"SelASD0\"}],\"container_backup_factor\":3,\"selectors\":[{\"name\":\"SelASD0\",\"count\":3,\"filter\":\"*\"}],\"filters\":[]}"
}

$ authmate ... --container-policy policy.json
line 1:0 token recognition error at: '{'
line 1:11 token recognition error at: ':'
line 1:12 token recognition error at: '['
line 1:13 token recognition error at: '{'
line 1:21 token recognition error at: ':'
line 1:23 token recognition error at: ','
line 1:34 token recognition error at: ':'
line 1:44 token recognition error at: '}'
line 1:45 token recognition error at: ']'
line 1:46 token recognition error at: ','
line 1:72 token recognition error at: ':'
line 1:74 token recognition error at: ','
line 1:86 token recognition error at: ':'
line 1:87 token recognition error at: '['
line 1:88 token recognition error at: '{'
line 1:95 token recognition error at: ':'
line 1:105 token recognition error at: ','
line 1:113 token recognition error at: ':'
line 1:115 token recognition error at: ','
line 1:124 token recognition error at: ':'
line 1:128 token recognition error at: '}'
line 1:129 token recognition error at: ']'
line 1:130 token recognition error at: ','
line 1:140 token recognition error at: ':'
line 1:141 token recognition error at: '['
line 1:142 token recognition error at: ']'
line 1:143 token recognition error at: '}'

{
  "access_key_id": "AiA47CP7bESAwbX8Kj4TC4ZtoRTdA23whe3otyVdtfzB03NgJc3g6Gu5tE3vEhsh84wZ7Lo9k5QTqnReDB3xuvEfx",
  "secret_access_key": "decb1164e31f5df1ef5ed0bdff89db297429657284ab9c935eea396cdf7b15cc",
  "owner_private_key": "ac0d4f6c3250a4a07c13f9320745beb508a57ea3c309cbcdc011d09eb8038891",
  "wallet_public_key": "031a6c6fbbdf02ca351745fa86b9ba5a9452d785ac4f7fc2b7548ca2a46c4fcf4a",
  "container_id": "AiA47CP7bESAwbX8Kj4TC4ZtoRTdA23whe3otyVdtfzB"
}
Originally created by @masterSplinter01 on GitHub (Jun 27, 2022). Originally assigned to: @cthulhu-rider on GitHub. I tried to create an accessbox using policy example from readme, authmate created a box with correct policy but printed some errors. ``` $ cat policy.json { "rep-3": "REP 3", "complex": "REP 1 IN X CBF 1 SELECT 1 FROM * AS X", "example-json-policy": "{\"replicas\":[{\"count\":3,\"selector\":\"SelASD0\"}],\"container_backup_factor\":3,\"selectors\":[{\"name\":\"SelASD0\",\"count\":3,\"filter\":\"*\"}],\"filters\":[]}" } $ authmate ... --container-policy policy.json line 1:0 token recognition error at: '{' line 1:11 token recognition error at: ':' line 1:12 token recognition error at: '[' line 1:13 token recognition error at: '{' line 1:21 token recognition error at: ':' line 1:23 token recognition error at: ',' line 1:34 token recognition error at: ':' line 1:44 token recognition error at: '}' line 1:45 token recognition error at: ']' line 1:46 token recognition error at: ',' line 1:72 token recognition error at: ':' line 1:74 token recognition error at: ',' line 1:86 token recognition error at: ':' line 1:87 token recognition error at: '[' line 1:88 token recognition error at: '{' line 1:95 token recognition error at: ':' line 1:105 token recognition error at: ',' line 1:113 token recognition error at: ':' line 1:115 token recognition error at: ',' line 1:124 token recognition error at: ':' line 1:128 token recognition error at: '}' line 1:129 token recognition error at: ']' line 1:130 token recognition error at: ',' line 1:140 token recognition error at: ':' line 1:141 token recognition error at: '[' line 1:142 token recognition error at: ']' line 1:143 token recognition error at: '}' { "access_key_id": "AiA47CP7bESAwbX8Kj4TC4ZtoRTdA23whe3otyVdtfzB03NgJc3g6Gu5tE3vEhsh84wZ7Lo9k5QTqnReDB3xuvEfx", "secret_access_key": "decb1164e31f5df1ef5ed0bdff89db297429657284ab9c935eea396cdf7b15cc", "owner_private_key": "ac0d4f6c3250a4a07c13f9320745beb508a57ea3c309cbcdc011d09eb8038891", "wallet_public_key": "031a6c6fbbdf02ca351745fa86b9ba5a9452d785ac4f7fc2b7548ca2a46c4fcf4a", "container_id": "AiA47CP7bESAwbX8Kj4TC4ZtoRTdA23whe3otyVdtfzB" } ```
sami 2025-12-28 17:36:47 +00:00
  • closed this issue
  • added the
    auth-mate
    label
Author
Owner

@KirillovDenis commented on GitHub (Jun 27, 2022):

As I understand the following invocation produce some output on error:
nspcc-dev/neofs-s3-gw@e84ff96593/authmate/authmate.go (L169-L174)

Probably we should create an issue in https://github.com/nspcc-dev/neofs-sdk-go

@KirillovDenis commented on GitHub (Jun 27, 2022): As I understand the following invocation produce some output on error: https://github.com/nspcc-dev/neofs-s3-gw/blob/e84ff965935436095e1bc2b846eaaa01804fd4eb/authmate/authmate.go#L169-L174 Probably we should create an issue in https://github.com/nspcc-dev/neofs-sdk-go
Author
Owner

@KirillovDenis commented on GitHub (Jun 28, 2022):

Can be fixed after PR will be merged

@KirillovDenis commented on GitHub (Jun 28, 2022): Can be fixed after [PR](https://github.com/nspcc-dev/neofs-sdk-go/pull/281) will be merged
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
nspcc-dev/neofs-s3-gw#265
No description provided.