~singpolyma/sgx-jmp

ref: da30c371e56b8bb577897f1151b59c24e209127f sgx-jmp/lib/trivial_backend_sgx_repo.rb -rw-r--r-- 658 bytes
da30c371Stephen Paul Weber Allow finishing admin command 11 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# frozen_string_literal: true

require_relative "backend_sgx"
require_relative "not_loaded"

class TrivialBackendSgxRepo
	def initialize(
		jid: CONFIG[:sgx],
		creds: CONFIG[:creds],
		component_jid: CONFIG[:component][:jid]
	)
		@jid = Blather::JID.new(jid)
		@creds = creds
		@component_jid = component_jid
	end

	def get(customer_id)
		BackendSgx.new(
			jid: @jid,
			creds: @creds,
			from_jid: Blather::JID.new("customer_#{customer_id}", @component_jid),
			ogm_url: NotLoaded.new(:ogm_url),
			fwd: NotLoaded.new(:fwd_timeout),
			transcription_enabled: NotLoaded.new(:transcription_enabled),
			registered?: NotLoaded.new(:registered?)
		)
	end
end