pass_server.rb
# Validate that the request is authorized to deal with the pass referenced
Validate that the request is authorized to deal with the pass referenced
Validate that the request is authorized to deal with the pass referenced
def is_auth_token_valid?(serial_number, pass_type_identifier, auth_token)
    begin
      pass = self.passes.where(:serial_number => serial_number, :pass_type_id => pass_type_identifier, :authentication_token => auth_token).first || raise(Sinatra::NotFound)
    rescue => e
      halt 500, 'DB access error'
    end
    if pass
      return pass
    else
      halt 401, 'ApplePass token for Pass is incorrect'
    end
  end
def is_auth_token_valid? ( serial_number , pass_type_identifier , auth_token ) begin pass = self . passes . where ( :serial_number => serial_number , :pass_type_id => pass_type_identifier , :authentication_token => auth_token ) . first || raise ( Sinatra :: NotFound ) rescue => e halt 500 , 'DB access error' end if pass return pass else halt 401 , 'ApplePass token for Pass is incorrect' end end
Validate that the request is authorized to deal with the pass referenced
Validate that the request is authorized to deal with the pass referenced
serial_number
<not_specific>
pass_type_identifier
<not_specific>
auth_token
<not_specific>