Class: Cerbos::Output::ServerInfo
- Inherits:
-
Object
- Object
- Cerbos::Output::ServerInfo
- Defined in:
- lib/cerbos/output/server_info.rb
Overview
Information about the Cerbos policy decision point (PDP) server.
Instance Attribute Summary collapse
-
#built_at ⇒ Time?
readonly
The time at which the PDP server binary was built.
-
#commit ⇒ String
readonly
The commit SHA from which the PDP server binary was built.
-
#version ⇒ String
readonly
The version of the PDP server.
Instance Attribute Details
#built_at ⇒ Time? (readonly)
The time at which the PDP server binary was built.
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/cerbos/output/server_info.rb', line 6 ServerInfo = Output.new_class(:built_at, :commit, :version) do # @!attribute [r] built_at # The time at which the PDP server binary was built. # # @return [Time] # @return [nil] if running a custom build of the PDP server that does not report its build time in ISO 8601 format. # @!attribute [r] commit # The commit SHA from which the PDP server binary was built. # # @return [String] # @!attribute [r] version # The version of the PDP server. # # @return [String] def self.from_protobuf(server_info) built_at = begin Time.iso8601(server_info.build_date) rescue ArgumentError nil end new( built_at: built_at, commit: server_info.commit, version: server_info.version ) end end |
#commit ⇒ String (readonly)
The commit SHA from which the PDP server binary was built.
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/cerbos/output/server_info.rb', line 6 ServerInfo = Output.new_class(:built_at, :commit, :version) do # @!attribute [r] built_at # The time at which the PDP server binary was built. # # @return [Time] # @return [nil] if running a custom build of the PDP server that does not report its build time in ISO 8601 format. # @!attribute [r] commit # The commit SHA from which the PDP server binary was built. # # @return [String] # @!attribute [r] version # The version of the PDP server. # # @return [String] def self.from_protobuf(server_info) built_at = begin Time.iso8601(server_info.build_date) rescue ArgumentError nil end new( built_at: built_at, commit: server_info.commit, version: server_info.version ) end end |
#version ⇒ String (readonly)
The version of the PDP server.
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/cerbos/output/server_info.rb', line 6 ServerInfo = Output.new_class(:built_at, :commit, :version) do # @!attribute [r] built_at # The time at which the PDP server binary was built. # # @return [Time] # @return [nil] if running a custom build of the PDP server that does not report its build time in ISO 8601 format. # @!attribute [r] commit # The commit SHA from which the PDP server binary was built. # # @return [String] # @!attribute [r] version # The version of the PDP server. # # @return [String] def self.from_protobuf(server_info) built_at = begin Time.iso8601(server_info.build_date) rescue ArgumentError nil end new( built_at: built_at, commit: server_info.commit, version: server_info.version ) end end |