Class: Etna::Clients::Janus::GenerateTokenWorkflow
- Inherits:
-
Struct
- Object
- Struct
- Etna::Clients::Janus::GenerateTokenWorkflow
- Defined in:
- lib/etna/clients/janus/workflows/generate_token_workflow.rb
Instance Attribute Summary collapse
-
#email ⇒ Object
Returns the value of attribute email.
-
#janus_client ⇒ Object
Returns the value of attribute janus_client.
-
#private_key_file ⇒ Object
Returns the value of attribute private_key_file.
-
#project_name ⇒ Object
Returns the value of attribute project_name.
-
#token_type ⇒ Object
Returns the value of attribute token_type.
Instance Method Summary collapse
Instance Attribute Details
#email ⇒ Object
Returns the value of attribute email
15 16 17 |
# File 'lib/etna/clients/janus/workflows/generate_token_workflow.rb', line 15 def email @email end |
#janus_client ⇒ Object
Returns the value of attribute janus_client
15 16 17 |
# File 'lib/etna/clients/janus/workflows/generate_token_workflow.rb', line 15 def janus_client @janus_client end |
#private_key_file ⇒ Object
Returns the value of attribute private_key_file
15 16 17 |
# File 'lib/etna/clients/janus/workflows/generate_token_workflow.rb', line 15 def private_key_file @private_key_file end |
#project_name ⇒ Object
Returns the value of attribute project_name
15 16 17 |
# File 'lib/etna/clients/janus/workflows/generate_token_workflow.rb', line 15 def project_name @project_name end |
#token_type ⇒ Object
Returns the value of attribute token_type
15 16 17 |
# File 'lib/etna/clients/janus/workflows/generate_token_workflow.rb', line 15 def token_type @token_type end |
Instance Method Details
#generate! ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/etna/clients/janus/workflows/generate_token_workflow.rb', line 16 def generate! nonce = janus_client.get_nonce unless email puts "Email address for #{janus_client.host} account?" email = STDIN.gets.chomp end if use_nonce? until private_key_file puts "Location of private key file?" private_key_file = ::File.(STDIN.gets.chomp) unless File.exists?(private_key_file) puts "No such file." private_key_file = nil end end end if needs_project_name? puts "Project name?" project_name = STDIN.gets.chomp end token = janus_client.generate_token(token_type, signed_nonce: use_nonce? ? signed_nonce(nonce) : nil, project_name: project_name) puts token end |