Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

policy size #24

Open
nirsnappy opened this issue Aug 18, 2020 · 4 comments
Open

policy size #24

nirsnappy opened this issue Aug 18, 2020 · 4 comments
Labels
enhancement New feature or request

Comments

@nirsnappy
Copy link

first of all look like a great idea! and the name is genius.

will you enforce policy size limit ?

@udondan
Copy link
Owner

udondan commented Aug 18, 2020

Thanks @nirsnappy!

That's a good idea. But quite tricky, I believe.

First of all, the package only creates single statements, not complete policies. So we can only ensure a single statement does not exceed the size limit. That would already be a good feature though! But then we have the problem of the varying character limits of policies:

Inline role policies: 10,240
Inline group policies: 5,120
Managed policies: 6,144
Inline user policies: 2,048
Assume policies: 2,048

Since we don't know in which context the statement is going to be used, the only option I can think of is to ask the user.

statement.ensureSize(10240) -> true|false

But that's not really helpful. It's the same as this, what the user can already do now:

statement.toJSON().toString().length <= 10240

(I probably should implement a toString method)

Yeah, so not sure about it 🤔

@niradler
Copy link

i always ending up google that:
Inline role policies: 10,240
Inline group policies: 5,120
Managed policies: 6,144
Inline user policies: 2,048
Assume policies: 2,048

again and again so it will be nice touch.
i agree about the toString() it can also minifey it to get more space.

@udondan udondan added the enhancement New feature or request label Oct 25, 2020
@skorfmann
Copy link

A combination of automatically reducing the policy size and perhaps some context aware auto splitting would be awesome. Something along the lines of ensureValidSize(PolicyTarget.MANAGED) which returns Math.ceil(policy.length / 6144) policies in this case.

@udondan
Copy link
Owner

udondan commented Dec 6, 2020

I have actually planned to add the concept of a full policy to Floyd and wanted to deal with it on that level. The policy then knows it's type (InlineUserPolicy, ManagedPolicy etc) and therefore it's maximum size. And yeah, it needs some auto-splitting capability. Otherwise it's no big help to know the policy is too large, but you can't do anything about it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants