Class: ReclaimOidc::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/reclaim_oidc.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, key, secret) ⇒ Client

Returns a new instance of Client.



105
106
107
108
109
# File 'lib/reclaim_oidc.rb', line 105

def initialize(name, key, secret)
  @name = name
  @key = key
  @secret = secret
end

Instance Attribute Details

#descriptionObject (readonly)

Returns the value of attribute description.



104
105
106
# File 'lib/reclaim_oidc.rb', line 104

def description
  @description
end

#keyObject (readonly)

Returns the value of attribute key.



104
105
106
# File 'lib/reclaim_oidc.rb', line 104

def key
  @key
end

#nameObject (readonly)

Returns the value of attribute name.



104
105
106
# File 'lib/reclaim_oidc.rb', line 104

def name
  @name
end

#redirect_uriObject (readonly)

Returns the value of attribute redirect_uri.



104
105
106
# File 'lib/reclaim_oidc.rb', line 104

def redirect_uri
  @redirect_uri
end

#secretObject (readonly)

Returns the value of attribute secret.



104
105
106
# File 'lib/reclaim_oidc.rb', line 104

def secret
  @secret
end

Class Method Details

.from_json(obj) ⇒ Object



110
111
112
# File 'lib/reclaim_oidc.rb', line 110

def self.from_json(obj)
  id = Client.new(obj['name'], obj['pubkey'], obj['secret'])
end

Instance Method Details

#parse_client_info(obj) ⇒ Object



113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# File 'lib/reclaim_oidc.rb', line 113

def parse_client_info(obj)
  obj.each do |record|
    if "@" != record["record_name"]
      next
    end
    record["data"].each do |data|
      if (data['record_type'] == 'RECLAIM_OIDC_CLIENT')
        @description = data['value']
      end
      if (data['record_type'] == 'RECLAIM_OIDC_REDIRECT')
        @redirect_uri = data['value']
      end
    end
  end
end