[#30] Client: Add object model for Rules #42
No reviewers
Labels
No labels
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-sdk-csharp#42
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "PavelGrossSpb/frostfs-sdk-csharp:apeRules"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Signed-off-by: Pavel Gross p.gross@yadro.com
@ -0,0 +91,4 @@
private static int ActionsSize(Actions? action)
{
return BoolSize // Inverted
+ (action != null ? SliceSize(action.Names, StringSize) : 0);
Null slice must have size 1
Seems that Golang SDK is not protected from null Action or Resources and panics in these cases. So, null Action/Resourse makes the rule invalid. I've fixed the code accordingly.
Golang SDK uses struct. It is value type, so it can't be nil.
You can do the same by using
struct
instead ofclass
OK, let it be structs. Done.
@ -0,0 +98,4 @@
private static int ResourcesSize(Resource? resource)
{
return BoolSize // Inverted
+ (resource != null ? SliceSize(resource.Names, StringSize) : 0);
Also, if null, then size must be 1. Some unit tests required.
Fixed, see previous comment
Great! What do you think about some positive/negative unit tests for serializer?
I'm working on it, but we've committed to provide this functionality today. So the tests will be some later.
Ok, will test on production. Hardcore!
a785357268
to195854a45b