-
Notifications
You must be signed in to change notification settings - Fork 181
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove v1 DF API from Python and Ruby (#1497)
* rm most of it * rm the rest from python * py docs update * sequel adapter * rm node df test * rm node add-to-your-app * no node * rm references to removed doc * rm another node example * restore node app Co-authored-by: Stephen Olsen <[email protected]>
- Loading branch information
Showing
38 changed files
with
184 additions
and
3,187 deletions.
There are no files selected for viewing
3 changes: 0 additions & 3 deletions
3
docs/content/node/getting-started/application/enforce/data/data.md
This file was deleted.
Oops, something went wrong.
11 changes: 11 additions & 0 deletions
11
docs/content/node/getting-started/application/enforce/index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
title: Enforce authorization | ||
description: | | ||
Add authorization enforcement throughout your application using the | ||
authorize API to reject or accept requests that users make. | ||
weight: 2 | ||
--- | ||
|
||
# Enforce authorization | ||
|
||
{{% coming_soon %}} |
23 changes: 0 additions & 23 deletions
23
docs/content/node/getting-started/application/filter-data/data/data.md
This file was deleted.
Oops, something went wrong.
19 changes: 19 additions & 0 deletions
19
docs/content/node/getting-started/application/filter-data/index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
title: Filter collections of data | ||
description: | | ||
Many applications perform authorization over large collections of data | ||
that cannot be loaded into memory. Often index pages showing users a | ||
number of resources, like the repositories they can access, will need to | ||
use data filtering. The data filtering API provides support for these | ||
use cases. | ||
weight: 4 | ||
--- | ||
|
||
# Filter collections of data | ||
|
||
{{% coming_soon %}} | ||
|
||
## What's next | ||
|
||
This is the end of __Add to your app__! For more detail on using | ||
Oso, see the [How to guides](/guides). |
11 changes: 0 additions & 11 deletions
11
docs/content/node/getting-started/application/model/data/data.md
This file was deleted.
Oops, something went wrong.
15 changes: 15 additions & 0 deletions
15
docs/content/node/getting-started/application/model/index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
title: Model your authorization logic | ||
description: | | ||
Authorization in Oso starts with the policy. Authorization policies | ||
define the resources that you want to control access to, and rules that | ||
specify when an actor (the user making the request) can perform an | ||
action on a resource. Because Oso is a library, you can write | ||
authorization policies directly over the same data types that are | ||
already used in your application. | ||
weight: 1 | ||
--- | ||
|
||
# Model your authorization logic | ||
|
||
{{% coming_soon %}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
110 changes: 0 additions & 110 deletions
110
docs/examples/add-to-your-application/node/dataFiltering.js
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
actor User {} | ||
|
||
resource Repository { | ||
permissions = ["read", "push", "delete"]; | ||
roles = ["contributor", "maintainer", "admin"]; | ||
|
||
"read" if "contributor"; | ||
"push" if "maintainer"; | ||
"delete" if "admin"; | ||
|
||
"maintainer" if "admin"; | ||
"contributor" if "maintainer"; | ||
} | ||
|
||
has_role(actor: User, role_name: String, repository: Repository) if | ||
role in actor.roles and | ||
role_name = role.name and | ||
repository = role.repository; | ||
|
||
allow(actor, action, resource) if | ||
has_permission(actor, action, resource); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,30 @@ | ||
from dataclasses import dataclass | ||
from typing import List | ||
|
||
|
||
@dataclass | ||
class Repository: | ||
name: str | ||
|
||
def get_by_name(name): | ||
return repos_db[name] | ||
|
||
repos_db = { | ||
"gmail": Repository("gmail") | ||
} | ||
|
||
repos_db = {"gmail": Repository("gmail")} | ||
|
||
# docs: start | ||
@dataclass | ||
class Role: | ||
name: str | ||
repository: Repository | ||
|
||
|
||
@dataclass | ||
class User: | ||
roles: List[Role] | ||
|
||
|
||
users_db = { | ||
"larry": User([Role(name="admin", | ||
repository=repos_db["gmail"])]), | ||
"larry": User([Role(name="admin", repository=repos_db["gmail"])]), | ||
} | ||
# docs: end |
Oops, something went wrong.
1 comment
on commit 37c0941
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rust Benchmark
Benchmark suite | Current: 37c0941 | Previous: 318f073 | Ratio |
---|---|---|---|
rust_get_attribute |
52276 ns/iter (± 2832 ) |
41132 ns/iter (± 1776 ) |
1.27 |
n_plus_one/100 |
2706361 ns/iter (± 129764 ) |
1991947 ns/iter (± 3197 ) |
1.36 |
n_plus_one/500 |
12509912 ns/iter (± 151151 ) |
9789828 ns/iter (± 29320 ) |
1.28 |
n_plus_one/1000 |
24895245 ns/iter (± 312801 ) |
19508195 ns/iter (± 53189 ) |
1.28 |
unify_once |
1112 ns/iter (± 53 ) |
893 ns/iter (± 145 ) |
1.25 |
unify_twice |
2971 ns/iter (± 227 ) |
2384 ns/iter (± 339 ) |
1.25 |
many_rules |
71458 ns/iter (± 1373 ) |
65042 ns/iter (± 1309 ) |
1.10 |
fib/5 |
599967 ns/iter (± 11696 ) |
472026 ns/iter (± 12820 ) |
1.27 |
prime/3 |
20435 ns/iter (± 929 ) |
16027 ns/iter (± 629 ) |
1.28 |
prime/23 |
20391 ns/iter (± 1027 ) |
15955 ns/iter (± 625 ) |
1.28 |
prime/43 |
21035 ns/iter (± 814 ) |
15916 ns/iter (± 633 ) |
1.32 |
prime/83 |
20541 ns/iter (± 1088 ) |
15871 ns/iter (± 600 ) |
1.29 |
prime/255 |
18695 ns/iter (± 851 ) |
14460 ns/iter (± 549 ) |
1.29 |
indexed/100 |
6807 ns/iter (± 619 ) |
5545 ns/iter (± 586 ) |
1.23 |
indexed/500 |
8674 ns/iter (± 1725 ) |
7701 ns/iter (± 1960 ) |
1.13 |
indexed/1000 |
10585 ns/iter (± 503 ) |
9487 ns/iter (± 704 ) |
1.12 |
indexed/10000 |
28526 ns/iter (± 1653 ) |
30550 ns/iter (± 1975 ) |
0.93 |
not |
6833 ns/iter (± 907 ) |
5388 ns/iter (± 138 ) |
1.27 |
double_not |
14094 ns/iter (± 267 ) |
11192 ns/iter (± 224 ) |
1.26 |
De_Morgan_not |
9394 ns/iter (± 316 ) |
7272 ns/iter (± 176 ) |
1.29 |
load_policy |
1021876 ns/iter (± 17862 ) |
807461 ns/iter (± 4539 ) |
1.27 |
partial_and/1 |
36785 ns/iter (± 1723 ) |
28509 ns/iter (± 1276 ) |
1.29 |
partial_and/5 |
126328 ns/iter (± 5126 ) |
97801 ns/iter (± 3237 ) |
1.29 |
partial_and/10 |
241103 ns/iter (± 5733 ) |
211437 ns/iter (± 4941 ) |
1.14 |
partial_and/20 |
488279 ns/iter (± 10562 ) |
428205 ns/iter (± 5604 ) |
1.14 |
partial_and/40 |
1098849 ns/iter (± 57589 ) |
928805 ns/iter (± 11340 ) |
1.18 |
partial_and/80 |
2426045 ns/iter (± 30565 ) |
2086813 ns/iter (± 6319 ) |
1.16 |
partial_and/100 |
3196867 ns/iter (± 44657 ) |
2778175 ns/iter (± 13978 ) |
1.15 |
partial_rule_depth/1 |
118301 ns/iter (± 4410 ) |
105007 ns/iter (± 4193 ) |
1.13 |
partial_rule_depth/5 |
383515 ns/iter (± 9828 ) |
300635 ns/iter (± 4654 ) |
1.28 |
partial_rule_depth/10 |
838572 ns/iter (± 14651 ) |
655815 ns/iter (± 33162 ) |
1.28 |
partial_rule_depth/20 |
2336650 ns/iter (± 26499 ) |
1840595 ns/iter (± 7830 ) |
1.27 |
partial_rule_depth/40 |
8820208 ns/iter (± 320385 ) |
7032133 ns/iter (± 134566 ) |
1.25 |
partial_rule_depth/80 |
50319438 ns/iter (± 2216503 ) |
41379555 ns/iter (± 258520 ) |
1.22 |
partial_rule_depth/100 |
90565159 ns/iter (± 1120374 ) |
76239674 ns/iter (± 462361 ) |
1.19 |
This comment was automatically generated by workflow using github-action-benchmark.
I guess the
get_repositories
implementation above should have been deleted as well.