Skip to content

Commit

Permalink
Merge pull request #108
Browse files Browse the repository at this point in the history
Ruek
  • Loading branch information
uatuko authored Sep 25, 2024
2 parents f05bee4 + 75e1dfb commit aad838d
Show file tree
Hide file tree
Showing 32 changed files with 201 additions and 203 deletions.
18 changes: 9 additions & 9 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ jobs:
services:
postgres:
env:
POSTGRES_DB: test-sentium
POSTGRES_PASSWORD: sentium
POSTGRES_USER: sentium
POSTGRES_DB: test-ruek
POSTGRES_PASSWORD: ruek
POSTGRES_USER: ruek
image: postgres:15
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
ports:
Expand All @@ -41,19 +41,19 @@ jobs:
- name: Setup Postgres
run: psql < db/schema.sql
env:
PGDATABASE: test-sentium
PGDATABASE: test-ruek
PGHOST: postgres
PGPASSWORD: sentium
PGUSER: sentium
PGPASSWORD: ruek
PGUSER: ruek
- name: Build
run: make
- name: Generate code coverage reports
run: make coverage:lcov
env:
PGDATABASE: test-sentium
PGDATABASE: test-ruek
PGHOST: postgres
PGPASSWORD: sentium
PGUSER: sentium
PGPASSWORD: ruek
PGUSER: ruek
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
tags: ${{ steps.meta.outputs.tags }}
- uses: actions/delete-package-versions@v5
with:
package-name: sentium
package-name: ruek
package-type: container
min-versions-to-keep: 2
delete-only-untagged-versions: true
20 changes: 10 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.23)
project(sentium VERSION 0.3.1 LANGUAGES CXX)
project(ruek VERSION 0.3.1 LANGUAGES CXX)

cmake_policy(SET CMP0135 NEW)

Expand All @@ -8,38 +8,38 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)

set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin)

option(SENTIUM_BUILD_BENCHMARKS
option(RUEK_BUILD_BENCHMARKS
"Build benchmarks" OFF
)

include(CMakeDependentOption)
cmake_dependent_option(SENTIUM_BUILD_TESTING
cmake_dependent_option(RUEK_BUILD_TESTING
"Build tests when this is the root project" ON
"CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR" OFF
)

cmake_dependent_option(SENTIUM_ENABLE_COVERAGE
"Enable code coverage when SENTIUM_BUILD_TESTING is enabled and this is the root project" ON
"SENTIUM_BUILD_TESTING;CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR" OFF
cmake_dependent_option(RUEK_ENABLE_COVERAGE
"Enable code coverage when RUEK_BUILD_TESTING is enabled and this is the root project" ON
"RUEK_BUILD_TESTING;CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR" OFF
)

if (SENTIUM_ENABLE_COVERAGE)
if (RUEK_ENABLE_COVERAGE)
if (NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang")
message(FATAL_ERROR
"Code coverage is only available with clang. "
"Can't continue with SENTIUM_ENABLE_COVERAGE=ON."
"Can't continue with RUEK_ENABLE_COVERAGE=ON."
)
endif()
endif()

include(cmake/dependencies.cmake)
include(cmake/googleapis.cmake)

if (SENTIUM_BUILD_TESTING)
if (RUEK_BUILD_TESTING)
enable_testing()
endif()

if (SENTIUM_BUILD_BENCHMARKS)
if (RUEK_BUILD_BENCHMARKS)
add_subdirectory(bench)
endif()

Expand Down
8 changes: 4 additions & 4 deletions Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ WORKDIR /tmp

RUN cmake -B build -G Ninja -S source/ \
-DCMAKE_BUILD_TYPE=Release \
-DSENTIUM_BUILD_TESTING=OFF
-DRUEK_BUILD_TESTING=OFF

RUN cmake --build build/ --config Release

Expand All @@ -26,8 +26,8 @@ RUN apt-get update \
libpq5 \
libprotobuf32

COPY --from=builder /tmp/build/bin/sentium /opt/sentium/bin/
COPY --from=builder /tmp/build/bin/ruek /opt/ruek/bin/

WORKDIR /opt/sentium
ENTRYPOINT [ "bin/sentium" ]
WORKDIR /opt/ruek
ENTRYPOINT [ "bin/ruek" ]
EXPOSE 8080
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
builddir = .build
bindir = $(builddir)/bin
binary = $(bindir)/sentium
binary = $(bindir)/ruek
benchbin = $(binary)_bench
buildfile = $(builddir)/build.ninja

Expand Down
56 changes: 28 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
# 🔐 Sentium
# 🔐 Ruek

[![license](https://img.shields.io/github/license/uatuko/sentium)](https://raw.githubusercontent.com/uatuko/sentium/main/LICENSE)
[![codecov](https://codecov.io/gh/uatuko/sentium/graph/badge.svg?token=KR9MkDkk8s)](https://codecov.io/gh/uatuko/sentium)
[![discussions](https://img.shields.io/github/discussions/uatuko/sentium)](https://github.com/uatuko/sentium/discussions)
[![release](https://img.shields.io/github/v/release/uatuko/sentium)](https://github.com/uatuko/sentium/releases)
[![license](https://img.shields.io/github/license/uatuko/ruek)](https://raw.githubusercontent.com/uatuko/ruek/main/LICENSE)
[![codecov](https://codecov.io/gh/uatuko/ruek/graph/badge.svg?token=KR9MkDkk8s)](https://codecov.io/gh/uatuko/ruek)
[![discussions](https://img.shields.io/github/discussions/uatuko/ruek)](https://github.com/uatuko/ruek/discussions)
[![release](https://img.shields.io/github/v/release/uatuko/ruek)](https://github.com/uatuko/ruek/releases)

Lightning fast, global scale authorization service without the overhead of yet another DSL[^1].

## What is Sentium?
## What is Ruek?

Sentium is an authorization service for securing your applications and services using zero trust[^2]
Ruek is an authorization service for securing your applications and services using zero trust[^2]
fine-grained authorization (FGA).

We designed Sentium to be as powerful and scalable as [Zanzibar — Google’s Consistent, Global Authorization System](https://research.google/pubs/zanzibar-googles-consistent-global-authorization-system/)
We designed Ruek to be as powerful and scalable as [Zanzibar — Google’s Consistent, Global Authorization System](https://research.google/pubs/zanzibar-googles-consistent-global-authorization-system/)
yet simple enough to start using without the overhead of having to learn a new DSL to define authorization models or policies.

### Why Sentium?
### Why Ruek?

There are other open-source (and commercial) authorization services, some are inspired by Google Zanzibar
while others tend to offer policy-as-code solutions. But almost all of these solutions require learning
Expand All @@ -24,7 +24,7 @@ a new DSL to create authorization models or define policies, which adds unnecess
Using an authorization service shouldn't come with a requirement to be an expert in building and maintaining
authorization models or policies. It should be as easy as using an API.

Sentium lean on well known API design principals to provide an authorization service that's easy to
Ruek lean on well known API design principals to provide an authorization service that's easy to
integrate, quick to master and flexible enough to handle complex requirements.


Expand Down Expand Up @@ -62,11 +62,11 @@ You can find a bit more detailed documentation in [docs/](docs/README.md).
❯ cmake -B .build -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DPostgreSQL_ADDITIONAL_VERSIONS=16 \
-DSENTIUM_ENABLE_COVERAGE=OFF
-Druek_ENABLE_COVERAGE=OFF
```

```
❯ cmake --build .build --target sentium
❯ cmake --build .build --target ruek
```

### Setting-up
Expand All @@ -76,20 +76,20 @@ You can find a bit more detailed documentation in [docs/](docs/README.md).
psql (16.1)
Type "help" for help.
postgres=# create user sentium;
postgres=# create user ruek;
CREATE ROLE
postgres=# create database sentium owner sentium;
postgres=# create database ruek owner ruek;
CREATE DATABASE
```

```
❯ psql --username=sentium --dbname=sentium < db/schema.sql
❯ psql --username=ruek --dbname=ruek < db/schema.sql
```

### Running

```
❯ PGDATABASE=sentium PGUSER=sentium ./.build/bin/sentium
❯ PGDATABASE=ruek PGUSER=ruek ./.build/bin/ruek
Listening on [127.0.0.1:8080] ...
```

Expand All @@ -102,9 +102,9 @@ Listening on [127.0.0.1:8080] ...
❯ grpcurl \
-import-path proto \
-import-path ./.build/_deps/googleapis-src \
-proto proto/sentium/api/v1/principals.proto \
-proto proto/ruek/api/v1/principals.proto \
-plaintext \
localhost:8080 sentium.api.v1.Principals/Create
localhost:8080 ruek.api.v1.Principals/Create
{
"id": "cn7qtdu56a1cqrj8kur0"
Expand All @@ -117,14 +117,14 @@ Listening on [127.0.0.1:8080] ...
❯ grpcurl \
-import-path proto \
-import-path ./.build/_deps/googleapis-src \
-proto proto/sentium/api/v1/authz.proto \
-proto proto/ruek/api/v1/authz.proto \
-plaintext \
-d '{
"principal_id": "cn7qtdu56a1cqrj8kur0",
"entity_type": "documents",
"entity_id": "65bd28aaa076ee8c8463cff8"
}' \
localhost:8080 sentium.api.v1.Authz/Grant
localhost:8080 ruek.api.v1.Authz/Grant
{}
```
Expand All @@ -135,14 +135,14 @@ Listening on [127.0.0.1:8080] ...
❯ grpcurl \
-import-path proto \
-import-path ./.build/_deps/googleapis-src \
-proto proto/sentium/api/v1/authz.proto \
-proto proto/ruek/api/v1/authz.proto \
-plaintext \
-d '{
"principal_id": "cn7qtdu56a1cqrj8kur0",
"entity_type": "documents",
"entity_id": "65bd28aaa076ee8c8463cff8"
}' \
localhost:8080 sentium.api.v1.Authz/Check
localhost:8080 ruek.api.v1.Authz/Check
{
"ok": true
Expand All @@ -155,9 +155,9 @@ Listening on [127.0.0.1:8080] ...
❯ grpcurl \
-import-path proto \
-import-path ./.build/_deps/googleapis-src \
-proto proto/sentium/api/v1/principals.proto \
-proto proto/ruek/api/v1/principals.proto \
-plaintext \
localhost:8080 sentium.api.v1.Principals/List
localhost:8080 ruek.api.v1.Principals/List
{
"principals": [
Expand All @@ -177,13 +177,13 @@ Listening on [127.0.0.1:8080] ...
❯ grpcurl \
-import-path proto \
-import-path ./.build/_deps/googleapis-src \
-proto proto/sentium/api/v1/entities.proto \
-proto proto/ruek/api/v1/entities.proto \
-plaintext \
-d '{
"principal_id": "cn7qtdu56a1cqrj8kur0",
"entity_type": "documents"
}' \
localhost:8080 sentium.api.v1.Entities/List
localhost:8080 ruek.api.v1.Entities/List
{
"entities": [
Expand All @@ -201,13 +201,13 @@ Listening on [127.0.0.1:8080] ...
❯ grpcurl \
-import-path proto \
-import-path ./.build/_deps/googleapis-src \
-proto proto/sentium/api/v1/entities.proto \
-proto proto/ruek/api/v1/entities.proto \
-plaintext \
-d '{
"entity_type": "documents",
"entity_id": "65bd28aaa076ee8c8463cff8"
}' \
localhost:8080 sentium.api.v1.Entities/ListPrincipals
localhost:8080 ruek.api.v1.Entities/ListPrincipals
{
"principals": [
Expand Down
2 changes: 1 addition & 1 deletion bench/relations_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "svc/common.h"
#include "svc/svc.h"

using namespace sentium::api::v1::Relations;
using namespace ruek::api::v1::Relations;

class bm_relations : public benchmark::Fixture {
public:
Expand Down
Loading

0 comments on commit aad838d

Please sign in to comment.