1 class KeepDisk < ArvadosModel
4 include CommonApiTemplate
5 before_validation :ensure_ping_secret
7 api_accessible :superuser, :extend => :common do |t|
21 raise "must have :ip and :ping_secret" unless o[:ip] and o[:ping_secret]
23 if o[:ping_secret] != self.ping_secret
24 logger.info "Ping: secret mismatch: received \"#{o[:ping_secret]}\" != \"#{self.info[:ping_secret]}\""
27 self.last_ping_at = Time.now
29 @bypass_arvados_authorization = true
36 def ensure_ping_secret
37 self.ping_secret ||= rand(2**256).to_s(36)
40 def permission_to_update
41 @bypass_arvados_authorization or super
44 def permission_to_create
45 current_user and current_user.is_admin