gitlab-glaz 0.0.2-aarch64-linux-gnu → 1.0.0-aarch64-linux-gnu
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Cargo.lock +2094 -0
- data/Cargo.toml +15 -0
- data/README.md +21 -37
- data/ext/glaz/Cargo.toml +1 -0
- data/ext/glaz/src/lib.rs +67 -14
- data/lib/gitlab/glaz/3.1/glaz.so +0 -0
- data/lib/gitlab/glaz/3.2/glaz.so +0 -0
- data/lib/gitlab/glaz/3.3/glaz.so +0 -0
- data/lib/gitlab/glaz/3.4/glaz.so +0 -0
- data/lib/gitlab/glaz/4.0/glaz.so +0 -0
- data/lib/gitlab/glaz/engine.rb +60 -0
- data/lib/gitlab/glaz/version.rb +1 -1
- data/lib/gitlab/glaz.rb +10 -11
- data/lib/proto/relationships/relationships_pb.rb +28 -0
- data/lib/proto/service_pb.rb +7 -5
- metadata +6 -2
data/Cargo.toml
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Root Cargo.toml - Defines the workspace
|
|
2
|
+
[workspace]
|
|
3
|
+
members = ["ext/*"]
|
|
4
|
+
resolver = "2"
|
|
5
|
+
|
|
6
|
+
[workspace.package]
|
|
7
|
+
version = "1.0.0"
|
|
8
|
+
edition = "2024"
|
|
9
|
+
|
|
10
|
+
# Shared dependencies for all crates
|
|
11
|
+
[workspace.dependencies]
|
|
12
|
+
magnus = { version = "0.8.2", features = ["rb-sys"] }
|
|
13
|
+
rb-sys = "0.9.128"
|
|
14
|
+
glaz-module = { git = "https://gitlab.com/gitlab-org/auth/glaz.git", rev = "13a32ad3f0e6490384afb6ba6a3c3e2a6439901a" }
|
|
15
|
+
glaz-roles = { git = "https://gitlab.com/gitlab-org/auth/glaz.git", rev = "13a32ad3f0e6490384afb6ba6a3c3e2a6439901a" }
|
data/README.md
CHANGED
|
@@ -3,68 +3,52 @@
|
|
|
3
3
|
> [!WARNING]
|
|
4
4
|
> This gem is currently designed entirely for internal use at GitLab.
|
|
5
5
|
|
|
6
|
-
Ruby bindings for the [Glaz](https://gitlab.com/gitlab-org/auth/glaz) authorization engine.
|
|
7
|
-
|
|
8
|
-
## Requirements
|
|
9
|
-
|
|
10
|
-
- Ruby >= 3.1
|
|
11
|
-
- Rust toolchain (for building the native extension)
|
|
6
|
+
Ruby bindings for the [Glaz](https://gitlab.com/gitlab-org/auth/glaz) authorization engine. A thin [Magnus](https://github.com/matsadler/magnus) FFI extension exposes the Rust `glaz-module` engine to Ruby, so Cedar policy checks run in-process.
|
|
12
7
|
|
|
13
8
|
## Installation
|
|
14
9
|
|
|
15
|
-
Add to your Gemfile:
|
|
10
|
+
Requires Ruby >= 3.1 and a Rust toolchain. Add to your Gemfile:
|
|
16
11
|
|
|
17
12
|
```ruby
|
|
18
13
|
gem 'gitlab-glaz', path: 'gems/gitlab-glaz'
|
|
19
14
|
```
|
|
20
15
|
|
|
21
|
-
## Building
|
|
22
|
-
|
|
23
|
-
The gem contains a Rust extension that must be compiled before use:
|
|
24
|
-
|
|
25
|
-
```shell
|
|
26
|
-
bundle exec rake compile
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
This compiles the Rust crate in `ext/glaz/` and places the resulting native library under `lib/glaz/`.
|
|
30
|
-
|
|
31
16
|
## Usage
|
|
32
17
|
|
|
33
18
|
```ruby
|
|
34
19
|
require 'gitlab-glaz'
|
|
35
20
|
|
|
36
|
-
|
|
37
|
-
```
|
|
21
|
+
engine = Gitlab::Glaz::Engine.new(schema: cedar_schema, policies: cedar_policies)
|
|
38
22
|
|
|
39
|
-
|
|
23
|
+
engine.check_action(
|
|
24
|
+
subject_uuid: user_uuid,
|
|
25
|
+
object_uuid: project_uuid,
|
|
26
|
+
action: 'read_docs',
|
|
27
|
+
context: {}
|
|
28
|
+
)
|
|
29
|
+
# => { allowed: true, reason: 'permit_granted' }
|
|
40
30
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
| Rust extension | `ext/glaz/` | Thin `#[magnus::init]` shim that delegates to `glaz-ruby` |
|
|
46
|
-
| Core engine | [`glaz-ruby`](https://gitlab.com/gitlab-org/auth/glaz) | Rust crate implementing the Glaz authorization engine |
|
|
31
|
+
# Swap the policy set at runtime; the previous set stays active if the
|
|
32
|
+
# new source fails to parse or validate against the schema:
|
|
33
|
+
engine.load_policies(new_cedar_policies)
|
|
34
|
+
```
|
|
47
35
|
|
|
48
|
-
|
|
36
|
+
The schema is loaded once at construction and cannot change; build a new engine to use a new schema.
|
|
49
37
|
|
|
50
|
-
|
|
38
|
+
Schemas must declare `User` and `Resource` entities (checks build `User::"<subject_uuid>"` and `Resource::"<object_uuid>"` UIDs), and every action's context type must include `user_permissions: Set<Action>`, which the engine injects with the checked action.
|
|
51
39
|
|
|
52
|
-
|
|
40
|
+
## Development
|
|
53
41
|
|
|
54
42
|
```shell
|
|
55
|
-
|
|
43
|
+
bundle exec rake compile # build the native extension (required before rspec)
|
|
44
|
+
bundle exec rspec
|
|
56
45
|
```
|
|
57
46
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
```shell
|
|
61
|
-
bundle exec rake
|
|
62
|
-
```
|
|
47
|
+
The extension crate lives in [`ext/glaz/`](ext/glaz/); shared Rust dependencies are declared in the root [`Cargo.toml`](Cargo.toml).
|
|
63
48
|
|
|
64
49
|
## Releasing a new version
|
|
65
50
|
|
|
66
|
-
|
|
67
|
-
Once merged, the new version with precompiled, native gems will automatically be published to RubyGems.
|
|
51
|
+
Create a merge request using the `Release` template and follow its instructions. Once merged, precompiled native gems are published to RubyGems automatically.
|
|
68
52
|
|
|
69
53
|
## License
|
|
70
54
|
|
data/ext/glaz/Cargo.toml
CHANGED
data/ext/glaz/src/lib.rs
CHANGED
|
@@ -1,26 +1,48 @@
|
|
|
1
1
|
use magnus::{Error, Ruby, prelude::*};
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
/// Thin 1:1 wrapper around `glaz_module::PermissionCheckEngine`. The engine
|
|
4
|
+
/// starts empty; `load_schema` must be called before `load_policies`, and
|
|
5
|
+
/// `check_action` fails with a RuntimeError until both are loaded.
|
|
6
|
+
#[magnus::wrap(class = "Glaz::PermissionCheckEngine")]
|
|
7
|
+
struct PermissionCheckEngine {
|
|
5
8
|
engine: glaz_module::PermissionCheckEngine,
|
|
6
9
|
}
|
|
7
10
|
|
|
8
|
-
impl
|
|
11
|
+
impl PermissionCheckEngine {
|
|
9
12
|
fn initialize(ruby: &Ruby) -> Result<Self, Error> {
|
|
10
|
-
glaz_module::PermissionCheckEngine::new()
|
|
11
|
-
|
|
12
|
-
|
|
13
|
+
let engine = glaz_module::PermissionCheckEngine::new().map_err(|e| map_error(ruby, e))?;
|
|
14
|
+
|
|
15
|
+
Ok(Self { engine })
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/// Load the Cedar schema. Re-loading a schema drops the active policies,
|
|
19
|
+
/// so callers should load the schema exactly once, before any policies.
|
|
20
|
+
fn load_schema(ruby: &Ruby, rb_self: &Self, schema: String) -> Result<(), Error> {
|
|
21
|
+
rb_self
|
|
22
|
+
.engine
|
|
23
|
+
.load_schema(&schema)
|
|
24
|
+
.map_err(|e| map_error(ruby, e))
|
|
13
25
|
}
|
|
14
26
|
|
|
15
|
-
|
|
27
|
+
/// Replace the active policy set with the given Cedar policy source,
|
|
28
|
+
/// validated against the loaded schema. On error the previous policies
|
|
29
|
+
/// remain active.
|
|
30
|
+
fn load_policies(ruby: &Ruby, rb_self: &Self, policies: String) -> Result<(), Error> {
|
|
31
|
+
rb_self
|
|
32
|
+
.engine
|
|
33
|
+
.load_policies(&policies)
|
|
34
|
+
.map_err(|e| map_error(ruby, e))
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
fn check_action(
|
|
16
38
|
ruby: &Ruby,
|
|
17
|
-
rb_self: &
|
|
39
|
+
rb_self: &Self,
|
|
18
40
|
proto_bytes: magnus::RString,
|
|
19
41
|
) -> Result<magnus::RHash, Error> {
|
|
20
42
|
let bytes = unsafe { proto_bytes.as_slice() };
|
|
21
43
|
let result = rb_self
|
|
22
44
|
.engine
|
|
23
|
-
.
|
|
45
|
+
.check(bytes)
|
|
24
46
|
.map_err(|e| map_error(ruby, e))?;
|
|
25
47
|
let hash = ruby.hash_new();
|
|
26
48
|
hash.aset(ruby.sym_new("allowed"), result.allowed)?;
|
|
@@ -29,10 +51,30 @@ impl CheckPermission {
|
|
|
29
51
|
}
|
|
30
52
|
}
|
|
31
53
|
|
|
54
|
+
/// Return the default roles embedded in the extension at build time (parsed
|
|
55
|
+
/// from glaz-roles' roles/**/*.yml) as an array of hashes shaped like
|
|
56
|
+
/// `{ id: String, name: String, permissions: [String, ...] }`.
|
|
57
|
+
fn roles(ruby: &Ruby) -> Result<magnus::RArray, Error> {
|
|
58
|
+
let array = ruby.ary_new();
|
|
59
|
+
for role in glaz_roles::default_roles() {
|
|
60
|
+
let hash = ruby.hash_new();
|
|
61
|
+
hash.aset(ruby.sym_new("id"), role.id.to_string())?;
|
|
62
|
+
hash.aset(ruby.sym_new("name"), role.name)?;
|
|
63
|
+
let permissions = ruby.ary_new();
|
|
64
|
+
for permission in &role.permissions {
|
|
65
|
+
permissions.push(permission.as_str())?;
|
|
66
|
+
}
|
|
67
|
+
hash.aset(ruby.sym_new("permissions"), permissions)?;
|
|
68
|
+
array.push(hash)?;
|
|
69
|
+
}
|
|
70
|
+
Ok(array)
|
|
71
|
+
}
|
|
72
|
+
|
|
32
73
|
fn map_error(ruby: &Ruby, e: glaz_module::GlazError) -> Error {
|
|
33
74
|
use glaz_module::GlazError::*;
|
|
34
75
|
match e {
|
|
35
76
|
InvalidArgument(_) => Error::new(ruby.exception_arg_error(), format!("{e}")),
|
|
77
|
+
NotInitialized(_) => Error::new(ruby.exception_runtime_error(), format!("{e}")),
|
|
36
78
|
Runtime(_) => Error::new(ruby.exception_runtime_error(), format!("{e}")),
|
|
37
79
|
}
|
|
38
80
|
}
|
|
@@ -40,12 +82,23 @@ fn map_error(ruby: &Ruby, e: glaz_module::GlazError) -> Error {
|
|
|
40
82
|
#[magnus::init]
|
|
41
83
|
fn init(ruby: &Ruby) -> Result<(), Error> {
|
|
42
84
|
let glaz = ruby.define_module("Glaz")?;
|
|
43
|
-
|
|
44
|
-
let class =
|
|
45
|
-
class.define_singleton_method(
|
|
85
|
+
glaz.define_singleton_method("roles", magnus::function!(roles, 0))?;
|
|
86
|
+
let class = glaz.define_class("PermissionCheckEngine", ruby.class_object())?;
|
|
87
|
+
class.define_singleton_method(
|
|
88
|
+
"new",
|
|
89
|
+
magnus::function!(PermissionCheckEngine::initialize, 0),
|
|
90
|
+
)?;
|
|
91
|
+
class.define_method(
|
|
92
|
+
"load_schema",
|
|
93
|
+
magnus::method!(PermissionCheckEngine::load_schema, 1),
|
|
94
|
+
)?;
|
|
95
|
+
class.define_method(
|
|
96
|
+
"load_policies",
|
|
97
|
+
magnus::method!(PermissionCheckEngine::load_policies, 1),
|
|
98
|
+
)?;
|
|
46
99
|
class.define_method(
|
|
47
|
-
"
|
|
48
|
-
magnus::method!(
|
|
100
|
+
"check_action",
|
|
101
|
+
magnus::method!(PermissionCheckEngine::check_action, 1),
|
|
49
102
|
)?;
|
|
50
103
|
Ok(())
|
|
51
104
|
}
|
data/lib/gitlab/glaz/3.1/glaz.so
CHANGED
|
Binary file
|
data/lib/gitlab/glaz/3.2/glaz.so
CHANGED
|
Binary file
|
data/lib/gitlab/glaz/3.3/glaz.so
CHANGED
|
Binary file
|
data/lib/gitlab/glaz/3.4/glaz.so
CHANGED
|
Binary file
|
data/lib/gitlab/glaz/4.0/glaz.so
CHANGED
|
Binary file
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "json"
|
|
4
|
+
|
|
5
|
+
module Gitlab
|
|
6
|
+
module Glaz
|
|
7
|
+
# Wraps a native Glaz::PermissionCheckEngine instance.
|
|
8
|
+
#
|
|
9
|
+
# The Cedar schema is fixed for the lifetime of the engine: it is loaded
|
|
10
|
+
# exactly once at construction and cannot be re-loaded; build a new Engine
|
|
11
|
+
# to change it. The policy set can be replaced at any time with
|
|
12
|
+
# #load_policies.
|
|
13
|
+
#
|
|
14
|
+
# Schemas must declare `User` and `Resource` entity types and declare
|
|
15
|
+
# each checkable action with `appliesTo { principal: [User], resource:
|
|
16
|
+
# [Resource], ... }`, because the engine builds `User::"<subject_uuid>"` and
|
|
17
|
+
# `Resource::"<object_uuid>"` entity UIDs for every check. The engine also
|
|
18
|
+
# injects `user_permissions` (a Set<Action> containing the checked action)
|
|
19
|
+
# into the Cedar context, so an action's declared context type must include
|
|
20
|
+
# `user_permissions: Set<Action>` alongside any custom attributes.
|
|
21
|
+
class Engine
|
|
22
|
+
# @param schema [String] Cedar schema source (`.cedarschema` DSL).
|
|
23
|
+
# @param policies [String] Cedar policy source, validated against the
|
|
24
|
+
# schema; ArgumentError is raised when either does not parse or the
|
|
25
|
+
# policies do not validate.
|
|
26
|
+
def initialize(schema:, policies:)
|
|
27
|
+
@native = ::Glaz::PermissionCheckEngine.new
|
|
28
|
+
@native.load_schema(schema)
|
|
29
|
+
@native.load_policies(policies)
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
# Replace the active policy set with the given Cedar policy source,
|
|
33
|
+
# validated against the engine's schema. Raises ArgumentError when the
|
|
34
|
+
# source does not parse or validate; the previous policies then remain
|
|
35
|
+
# active. The swap is atomic with respect to concurrent checks.
|
|
36
|
+
def load_policies(source)
|
|
37
|
+
@native.load_policies(source)
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
# Evaluate whether the subject may perform +action+ on the object.
|
|
41
|
+
#
|
|
42
|
+
# @param context [Hash] ABAC attributes made available to policies as the
|
|
43
|
+
# Cedar context; must match the context type the schema declares for
|
|
44
|
+
# the checked action.
|
|
45
|
+
# @return [Hash] { allowed: Boolean, reason: String }
|
|
46
|
+
def check_action(subject_uuid:, object_uuid:, action:, context: {})
|
|
47
|
+
request = ::Glaz::CheckRequest.encode(
|
|
48
|
+
::Glaz::CheckRequest.new(
|
|
49
|
+
subject: ::Relationships::V1::Principal.new(id: subject_uuid),
|
|
50
|
+
action: action,
|
|
51
|
+
object: ::Relationships::V1::Object.new(id: object_uuid),
|
|
52
|
+
context: context.to_json
|
|
53
|
+
)
|
|
54
|
+
)
|
|
55
|
+
|
|
56
|
+
@native.check_action(request)
|
|
57
|
+
end
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end
|
data/lib/gitlab/glaz/version.rb
CHANGED
data/lib/gitlab/glaz.rb
CHANGED
|
@@ -6,21 +6,20 @@ require "proto/service_pb"
|
|
|
6
6
|
|
|
7
7
|
load_rust_extension
|
|
8
8
|
|
|
9
|
+
require_relative "glaz/engine"
|
|
10
|
+
|
|
9
11
|
module Gitlab
|
|
10
12
|
module Glaz
|
|
11
13
|
module_function
|
|
12
14
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
)
|
|
22
|
-
|
|
23
|
-
::Glaz::Engine::CheckPermission.new.check_permission(request)
|
|
15
|
+
# Returns the default roles embedded in the native extension at build time,
|
|
16
|
+
# sourced from the glaz-roles crate's roles/**/*.yml definitions. Each entry
|
|
17
|
+
# is a hash: { id: String, name: String, permissions: Array<String> }.
|
|
18
|
+
def roles
|
|
19
|
+
@roles ||= ::Glaz.roles.each do |role|
|
|
20
|
+
role[:permissions].freeze
|
|
21
|
+
role.freeze
|
|
22
|
+
end.freeze
|
|
24
23
|
end
|
|
25
24
|
end
|
|
26
25
|
end
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
|
+
# source: proto/relationships/relationships.proto
|
|
4
|
+
|
|
5
|
+
require 'google/protobuf'
|
|
6
|
+
|
|
7
|
+
require 'google/protobuf/timestamp_pb'
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
descriptor_data = "\n\'proto/relationships/relationships.proto\x12\x10relationships.v1\x1a\x1fgoogle/protobuf/timestamp.proto\"\x14\n\x06Object\x12\n\n\x02id\x18\x01 \x01(\t\"\x17\n\tPrincipal\x12\n\n\x02id\x18\x01 \x01(\t\"\x12\n\x04Role\x12\n\n\x02id\x18\x01 \x01(\t\"Y\n\x08Identity\x12(\n\x06origin\x18\x01 \x01(\x0e\x32\x18.relationships.v1.Origin\x12\x11\n\torigin_id\x18\x02 \x01(\t\x12\x10\n\x08local_id\x18\x03 \x01(\t\"q\n\x07Subject\x12.\n\x08identity\x18\x01 \x01(\x0b\x32\x1a.relationships.v1.IdentityH\x00\x12\x30\n\tprincipal\x18\x02 \x01(\x0b\x32\x1b.relationships.v1.PrincipalH\x00\x42\x04\n\x02id\"\xdf\x01\n\x0cRelationship\x12*\n\x07subject\x18\x01 \x01(\x0b\x32\x19.relationships.v1.Subject\x12(\n\x06object\x18\x02 \x01(\x0b\x32\x18.relationships.v1.Object\x12$\n\x04kind\x18\x03 \x01(\x0e\x32\x16.relationships.v1.Kind\x12$\n\x04role\x18\x04 \x01(\x0b\x32\x16.relationships.v1.Role\x12-\n\ttimestamp\x18\x05 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\"\xb5\x01\n\x11RelationshipInput\x12*\n\x07subject\x18\x01 \x01(\x0b\x32\x19.relationships.v1.Subject\x12(\n\x06object\x18\x02 \x01(\x0b\x32\x18.relationships.v1.Object\x12$\n\x04kind\x18\x03 \x01(\x0e\x32\x16.relationships.v1.Kind\x12$\n\x04role\x18\x04 \x01(\x0b\x32\x16.relationships.v1.Role\"\x8d\x01\n\x0fRelationshipKey\x12*\n\x07subject\x18\x01 \x01(\x0b\x32\x19.relationships.v1.Subject\x12(\n\x06object\x18\x02 \x01(\x0b\x32\x18.relationships.v1.Object\x12$\n\x04kind\x18\x03 \x01(\x0e\x32\x16.relationships.v1.Kind*1\n\x04Kind\x12\x14\n\x10KIND_UNSPECIFIED\x10\x00\x12\x13\n\x0fKIND_ASSIGNMENT\x10\x01*N\n\x06Origin\x12\x16\n\x12ORIGIN_UNSPECIFIED\x10\x00\x12\x0f\n\x0bORIGIN_SELF\x10\x01\x12\x1b\n\x17ORIGIN_GITLAB_FEDERATED\x10\x02\x42\x34Z2gitlab.com/gitlab-org/auth/iam/proto/relationshipsb\x06proto3"
|
|
11
|
+
|
|
12
|
+
pool = ::Google::Protobuf::DescriptorPool.generated_pool
|
|
13
|
+
pool.add_serialized_file(descriptor_data)
|
|
14
|
+
|
|
15
|
+
module Relationships
|
|
16
|
+
module V1
|
|
17
|
+
Object = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("relationships.v1.Object").msgclass
|
|
18
|
+
Principal = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("relationships.v1.Principal").msgclass
|
|
19
|
+
Role = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("relationships.v1.Role").msgclass
|
|
20
|
+
Identity = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("relationships.v1.Identity").msgclass
|
|
21
|
+
Subject = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("relationships.v1.Subject").msgclass
|
|
22
|
+
Relationship = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("relationships.v1.Relationship").msgclass
|
|
23
|
+
RelationshipInput = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("relationships.v1.RelationshipInput").msgclass
|
|
24
|
+
RelationshipKey = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("relationships.v1.RelationshipKey").msgclass
|
|
25
|
+
Kind = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("relationships.v1.Kind").enummodule
|
|
26
|
+
Origin = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("relationships.v1.Origin").enummodule
|
|
27
|
+
end
|
|
28
|
+
end
|
data/lib/proto/service_pb.rb
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
|
-
|
|
3
2
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
4
|
-
# source: service.proto
|
|
3
|
+
# source: proto/service.proto
|
|
5
4
|
|
|
6
5
|
require 'google/protobuf'
|
|
7
6
|
|
|
8
|
-
|
|
7
|
+
require 'proto/relationships/relationships_pb'
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
descriptor_data = "\n\x13proto/service.proto\x12\x04glaz\x1a\'proto/relationships/relationships.proto\"?\n\x0e\x45xplainRequest\x12\x0f\n\x07subject\x18\x01 \x01(\t\x12\x0e\n\x06object\x18\x02 \x01(\t\x12\x0c\n\x04role\x18\x03 \x01(\x05\"2\n\x0f\x45xplainResponse\x12\x0f\n\x07\x61llowed\x18\x01 \x01(\x08\x12\x0e\n\x06reason\x18\x02 \x01(\t\"2\n\x0f\x45valuateRequest\x12\x0f\n\x07subject\x18\x01 \x01(\t\x12\x0e\n\x06object\x18\x02 \x01(\t\"3\n\x10\x45valuateResponse\x12\x0f\n\x07\x61llowed\x18\x01 \x01(\x08\x12\x0e\n\x06reason\x18\x02 \x01(\t\"\xbe\x01\n\x0c\x43heckRequest\x12,\n\x07subject\x18\x01 \x01(\x0b\x32\x1b.relationships.v1.Principal\x12\x0e\n\x06\x61\x63tion\x18\x02 \x01(\t\x12(\n\x06object\x18\x03 \x01(\x0b\x32\x18.relationships.v1.Object\x12\x35\n\rrelationships\x18\x04 \x03(\x0b\x32\x1e.relationships.v1.Relationship\x12\x0f\n\x07\x63ontext\x18\x05 \x01(\t\"0\n\rCheckResponse\x12\x0f\n\x07\x61llowed\x18\x01 \x01(\x08\x12\x0e\n\x06reason\x18\x02 \x01(\t2\xbb\x01\n\x14\x41uthorizationService\x12\x36\n\x07\x45xplain\x12\x14.glaz.ExplainRequest\x1a\x15.glaz.ExplainResponse\x12\x39\n\x08\x45valuate\x12\x15.glaz.EvaluateRequest\x1a\x16.glaz.EvaluateResponse\x12\x30\n\x05\x43heck\x12\x12.glaz.CheckRequest\x1a\x13.glaz.CheckResponseb\x06proto3"
|
|
9
11
|
|
|
10
12
|
pool = ::Google::Protobuf::DescriptorPool.generated_pool
|
|
11
13
|
pool.add_serialized_file(descriptor_data)
|
|
@@ -15,6 +17,6 @@ module Glaz
|
|
|
15
17
|
ExplainResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("glaz.ExplainResponse").msgclass
|
|
16
18
|
EvaluateRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("glaz.EvaluateRequest").msgclass
|
|
17
19
|
EvaluateResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("glaz.EvaluateResponse").msgclass
|
|
18
|
-
|
|
19
|
-
|
|
20
|
+
CheckRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("glaz.CheckRequest").msgclass
|
|
21
|
+
CheckResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("glaz.CheckResponse").msgclass
|
|
20
22
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: gitlab-glaz
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0
|
|
4
|
+
version: 1.0.0
|
|
5
5
|
platform: aarch64-linux-gnu
|
|
6
6
|
authors:
|
|
7
7
|
- group::authorization
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-07-07 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: google-protobuf
|
|
@@ -88,6 +88,8 @@ executables: []
|
|
|
88
88
|
extensions: []
|
|
89
89
|
extra_rdoc_files: []
|
|
90
90
|
files:
|
|
91
|
+
- Cargo.lock
|
|
92
|
+
- Cargo.toml
|
|
91
93
|
- LICENSE
|
|
92
94
|
- README.md
|
|
93
95
|
- ext/glaz/Cargo.toml
|
|
@@ -99,8 +101,10 @@ files:
|
|
|
99
101
|
- lib/gitlab/glaz/3.3/glaz.so
|
|
100
102
|
- lib/gitlab/glaz/3.4/glaz.so
|
|
101
103
|
- lib/gitlab/glaz/4.0/glaz.so
|
|
104
|
+
- lib/gitlab/glaz/engine.rb
|
|
102
105
|
- lib/gitlab/glaz/loader.rb
|
|
103
106
|
- lib/gitlab/glaz/version.rb
|
|
107
|
+
- lib/proto/relationships/relationships_pb.rb
|
|
104
108
|
- lib/proto/service_pb.rb
|
|
105
109
|
homepage: https://gitlab.com/gitlab-org/ruby/gems/gitlab-glaz
|
|
106
110
|
licenses:
|