Sha256: e88be9dcb59d31b800ffa1cd3699caf251c2ae94ccbabcbeb80d12dd6dc14f5a

Contents?: true

Size: 1.21 KB

Versions: 29

Compression:

Stored size: 1.21 KB

Contents

#!/usr/bin/env ruby 

require 'mux_ruby'
require 'solid_assert'

SolidAssert.enable_assertions

# Authentication Setup
openapi = MuxRuby.configure do |config|
  config.username = ENV['MUX_TOKEN_ID']
  config.password = ENV['MUX_TOKEN_SECRET']
end

# API Client Initialization
keys_api = MuxRuby::URLSigningKeysApi.new

# ========== create-url-signing-key ==========
key = keys_api.create_url_signing_key()
assert key != nil
assert key.data.id != nil
assert key.data.private_key != nil
puts "create-url-signing-key OK ✅"

# ========== list-url-signing-keys ==========
keys = keys_api.list_url_signing_keys()
assert keys != nil
assert keys.data.first != nil
assert keys.data.first.id = key.data.id
assert keys.data.first.private_key == nil
puts "list-url-signing-keys OK ✅"

# ========== get-url-signing-key ==========
key_get = keys_api.get_url_signing_key(key.data.id)
assert key_get.data != nil
puts "get-url-signing-key OK ✅"

# ========== delete-url-signing-key ==========
keys_api.delete_url_signing_key(key.data.id)
begin
    deleted_key = keys_api.get_url_signing_key(key.data.id)
    puts 'Should have errored here.'
    exit 255
rescue MuxRuby::NotFoundError => e
    assert e != nil
end
puts "delete-url-signing-key OK ✅"

Version data entries

29 entries across 29 versions & 1 rubygems

Version Path
mux_ruby-3.9.0 examples/video/exercise-signing-keys.rb
mux_ruby-3.8.0 examples/video/exercise-signing-keys.rb
mux_ruby-3.7.0 examples/video/exercise-signing-keys.rb
mux_ruby-3.6.0 examples/video/exercise-signing-keys.rb
mux_ruby-3.5.2 examples/video/exercise-signing-keys.rb
mux_ruby-3.5.1 examples/video/exercise-signing-keys.rb
mux_ruby-3.5.0 examples/video/exercise-signing-keys.rb
mux_ruby-3.4.0 examples/video/exercise-signing-keys.rb
mux_ruby-3.3.1 examples/video/exercise-signing-keys.rb
mux_ruby-3.3.0 examples/video/exercise-signing-keys.rb
mux_ruby-3.2.0 examples/video/exercise-signing-keys.rb
mux_ruby-3.1.0 examples/video/exercise-signing-keys.rb
mux_ruby-3.0.0 examples/video/exercise-signing-keys.rb
mux_ruby-2.2.0 examples/video/exercise-signing-keys.rb
mux_ruby-2.1.1 examples/video/exercise-signing-keys.rb
mux_ruby-2.1.0 examples/video/exercise-signing-keys.rb
mux_ruby-2.0.0 examples/video/exercise-signing-keys.rb
mux_ruby-2.0.0.pre.rc.2 examples/video/exercise-signing-keys.rb
mux_ruby-2.0.0.pre.rc.1 examples/video/exercise-signing-keys.rb
mux_ruby-1.9.0 examples/video/exercise-signing-keys.rb