Skip to content

EventSubmition & EventSubmitionRule domain struct #27

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

Closed
1 of 3 tasks
elpiel opened this issue May 22, 2019 · 6 comments
Closed
1 of 3 tasks

EventSubmition & EventSubmitionRule domain struct #27

elpiel opened this issue May 22, 2019 · 6 comments
Milestone

Comments

@elpiel
Copy link
Member

elpiel commented May 22, 2019

https://github.com/AdExNetwork/adex-protocol/blob/master/campaignSpec.md#eventsubmission

EventSubmittion:
  • allow: array of EventSubmissionRule; for each POST to /channel/:id/events, the first rule that matches will apply
EventSubmissionRule:
  • uids: array of used IDs that this rule applies to; leave null for applying to everyone (note that subsequent rules in allow won't match); set to [null] to apply to requests without authentication
  • rateLimit: optional, object describing the rate limit to apply; for, this takes { type: "ip", timeframe }, where timeframe is a number; later, { type: "uid", timeframe } will be added

Examples

{ allow: [{ uids: null, rateLimit: { type: "ip", timeframe: 1000 } }] } - this will allow everyone to submit events, at a rate of 1 event per second per IP

{ allow: [{ uids: [channel.creator] }, { uids: null, rateLimit: { type: "ip", timeframe: 1000 } }] } - this will allow the creator to submit as many events as they like, but everyone else will be restricted to 1 event per second per IP

@elpiel elpiel mentioned this issue May 22, 2019
8 tasks
@elpiel
Copy link
Member Author

elpiel commented May 28, 2019

@Ivshti can you elaborate on the EventSubmissionRule::uuids ?
is the channel.creator the actual value of the Channel creator or it's a parameter of type Enum (channel.creator, validator.leader, validator.follower)?

@Ivshti
Copy link
Member

Ivshti commented May 28, 2019 via email

@elpiel
Copy link
Member Author

elpiel commented May 28, 2019

Yep, this helps. Thanks.

@elpiel
Copy link
Member Author

elpiel commented May 29, 2019

Closed #36 as we discussed we will just use String.

Ivshti pushed a commit that referenced this issue May 30, 2019
…SubmitionRule

Issue #27 EventSubmition & EventSubmitionRule
@elpiel
Copy link
Member Author

elpiel commented May 31, 2019

What is the allowed timeframe range @Ivshti ?
Also:

  • Should empty uids & null uids be treated as NULL (aka None)?
  • What if we have uids = null and rate_limit = null should we force one or the other in the Struct & in the deserilzation of the struct?

@elpiel
Copy link
Member Author

elpiel commented Jun 10, 2019

As discussed with @Ivshti , having both uids & rate_limit to NULL, is a valid case.
If we have:
[rule1, rule2, rule3, {uids: null, rateLimit: null}]
Everything that is not falling into rule1, rule2, rule3 is unlimited.

This case is valid and for that reason we will not force any checks atm.

@elpiel elpiel added this to the 0.2.0 milestone Jun 18, 2019
@elpiel elpiel closed this as completed Aug 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants