Class: KeycloakAdmin::CredentialRepresentation
- Inherits:
-
Representation
- Object
- Representation
- KeycloakAdmin::CredentialRepresentation
- Defined in:
- lib/keycloak-admin/representation/credential_representation.rb
Instance Attribute Summary collapse
-
#algorithm ⇒ Object
Returns the value of attribute algorithm.
-
#config ⇒ Object
Returns the value of attribute config.
-
#counter ⇒ Object
Returns the value of attribute counter.
-
#createdDate ⇒ Object
Returns the value of attribute createdDate.
-
#credentialData ⇒ Object
Returns the value of attribute credentialData.
-
#device ⇒ Object
Returns the value of attribute device.
-
#digits ⇒ Object
Returns the value of attribute digits.
-
#hashedSaltedValue ⇒ Object
Returns the value of attribute hashedSaltedValue.
-
#hashIterations ⇒ Object
Returns the value of attribute hashIterations.
-
#id ⇒ Object
Returns the value of attribute id.
-
#period ⇒ Object
Returns the value of attribute period.
-
#salt ⇒ Object
Returns the value of attribute salt.
-
#secretData ⇒ Object
Returns the value of attribute secretData.
-
#temporary ⇒ Object
Returns the value of attribute temporary.
-
#type ⇒ Object
Returns the value of attribute type.
-
#userLabel ⇒ Object
Returns the value of attribute userLabel.
-
#value ⇒ Object
Returns the value of attribute value.
Class Method Summary collapse
- .from_hash(hash) ⇒ Object
- .from_json(json) ⇒ Object
- .from_password(password, temporary = false) ⇒ Object
Methods inherited from Representation
Methods included from CamelJson
Instance Attribute Details
#algorithm ⇒ Object
Returns the value of attribute algorithm.
3 4 5 |
# File 'lib/keycloak-admin/representation/credential_representation.rb', line 3 def algorithm @algorithm end |
#config ⇒ Object
Returns the value of attribute config.
3 4 5 |
# File 'lib/keycloak-admin/representation/credential_representation.rb', line 3 def config @config end |
#counter ⇒ Object
Returns the value of attribute counter.
3 4 5 |
# File 'lib/keycloak-admin/representation/credential_representation.rb', line 3 def counter @counter end |
#createdDate ⇒ Object
Returns the value of attribute createdDate.
3 4 5 |
# File 'lib/keycloak-admin/representation/credential_representation.rb', line 3 def createdDate @createdDate end |
#credentialData ⇒ Object
Returns the value of attribute credentialData.
3 4 5 |
# File 'lib/keycloak-admin/representation/credential_representation.rb', line 3 def credentialData @credentialData end |
#device ⇒ Object
Returns the value of attribute device.
3 4 5 |
# File 'lib/keycloak-admin/representation/credential_representation.rb', line 3 def device @device end |
#digits ⇒ Object
Returns the value of attribute digits.
3 4 5 |
# File 'lib/keycloak-admin/representation/credential_representation.rb', line 3 def digits @digits end |
#hashedSaltedValue ⇒ Object
Returns the value of attribute hashedSaltedValue.
3 4 5 |
# File 'lib/keycloak-admin/representation/credential_representation.rb', line 3 def hashedSaltedValue @hashedSaltedValue end |
#hashIterations ⇒ Object
Returns the value of attribute hashIterations.
3 4 5 |
# File 'lib/keycloak-admin/representation/credential_representation.rb', line 3 def hashIterations @hashIterations end |
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/keycloak-admin/representation/credential_representation.rb', line 3 def id @id end |
#period ⇒ Object
Returns the value of attribute period.
3 4 5 |
# File 'lib/keycloak-admin/representation/credential_representation.rb', line 3 def period @period end |
#salt ⇒ Object
Returns the value of attribute salt.
3 4 5 |
# File 'lib/keycloak-admin/representation/credential_representation.rb', line 3 def salt @salt end |
#secretData ⇒ Object
Returns the value of attribute secretData.
3 4 5 |
# File 'lib/keycloak-admin/representation/credential_representation.rb', line 3 def secretData @secretData end |
#temporary ⇒ Object
Returns the value of attribute temporary.
3 4 5 |
# File 'lib/keycloak-admin/representation/credential_representation.rb', line 3 def temporary @temporary end |
#type ⇒ Object
Returns the value of attribute type.
3 4 5 |
# File 'lib/keycloak-admin/representation/credential_representation.rb', line 3 def type @type end |
#userLabel ⇒ Object
Returns the value of attribute userLabel.
3 4 5 |
# File 'lib/keycloak-admin/representation/credential_representation.rb', line 3 def userLabel @userLabel end |
#value ⇒ Object
Returns the value of attribute value.
3 4 5 |
# File 'lib/keycloak-admin/representation/credential_representation.rb', line 3 def value @value end |
Class Method Details
.from_hash(hash) ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/keycloak-admin/representation/credential_representation.rb', line 34 def self.from_hash(hash) credential = new hash.each do |key, value| if credential.respond_to?("#{key}=") credential.public_send("#{key}=", value) end end nested_attributes = safely_parse_nested_json(hash["credentialData"]).merge(safely_parse_nested_json(hash["secretData"])) nested_attributes.each do |key, value| if credential.respond_to?("#{key}=") current_value = credential.public_send(key) if current_value.nil? credential.public_send("#{key}=", value) end end end credential end |
.from_json(json) ⇒ Object
29 30 31 32 |
# File 'lib/keycloak-admin/representation/credential_representation.rb', line 29 def self.from_json(json) attributes = JSON.parse(json) from_hash(attributes) end |
.from_password(password, temporary = false) ⇒ Object
21 22 23 24 25 26 27 |
# File 'lib/keycloak-admin/representation/credential_representation.rb', line 21 def self.from_password(password, temporary=false) credential = new credential.value = password credential.type = "password" credential.temporary = temporary credential end |