Class: Legion::Crypt::Spiffe::SpiffeId

Inherits:
Struct
  • Object
show all
Defined in:
lib/legion/crypt/spiffe.rb

Overview

Parsed representation of a SPIFFE ID. A SPIFFE ID has the form: spiffe://<trust-domain>/<workload-path>

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#pathObject

Returns the value of attribute path

Returns:

  • (Object)

    the current value of path



22
23
24
# File 'lib/legion/crypt/spiffe.rb', line 22

def path
  @path
end

#trust_domainObject

Returns the value of attribute trust_domain

Returns:

  • (Object)

    the current value of trust_domain



22
23
24
# File 'lib/legion/crypt/spiffe.rb', line 22

def trust_domain
  @trust_domain
end

Instance Method Details

#==(other) ⇒ Object



27
28
29
# File 'lib/legion/crypt/spiffe.rb', line 27

def ==(other)
  other.is_a?(SpiffeId) && trust_domain == other.trust_domain && path == other.path
end

#to_sObject



23
24
25
# File 'lib/legion/crypt/spiffe.rb', line 23

def to_s
  "#{SPIFFE_SCHEME}://#{trust_domain}#{path}"
end