from u2flib_server.jsapi import (JSONDict, RegisterRequest, RegisterResponse,
                                 SignRequest, SignResponse)

__all__ = [
    'RegisterRequestData',
    'RegisterResponseData',
    'AuthenticateRequestData',
    'AuthenticateResponseData'
]


class RegisterRequestData(JSONDict):

    @property
    def authenticateRequests(self):
        return map(SignRequest, self['authenticateRequests'])

    @property
    def registerRequests(self):
        return map(RegisterRequest, self['registerRequests'])


class RegisterResponseData(JSONDict):

    @property
    def registerResponse(self):
        return RegisterResponse(self['registerResponse'])

    @property
    def getProps(self):
        return self.get('getProps', [])

    @property
    def setProps(self):
        return self.get('setProps', {})


class AuthenticateRequestData(JSONDict):

    @property
    def authenticateRequests(self):
        return map(SignRequest, self['authenticateRequests'])


class AuthenticateResponseData(JSONDict):

    @property
    def authenticateResponse(self):
        return SignResponse(self['authenticateResponse'])

    @property
    def getProps(self):
        return self.get('getProps', [])

    @property
    def setProps(self):
        return self.get('setProps', {})

@@ -1,8 +1,710 @@
+#    Copyright (C) 2014  Yubico AB%0A#%0A#    This program is free software: you can redistribute it and/or modify%0A#    it under the terms of the GNU General Public License as published by%0A#    the Free Software Foundation, either version 3 of the License, or%0A#    (at your option) any later version.%0A#%0A#    This program is distributed in the hope that it will be useful,%0A#    but WITHOUT ANY WARRANTY; without even the implied warranty of%0A#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the%0A#    GNU General Public License for more details.%0A#%0A#    You should have received a copy of the GNU General Public License%0A#    along with this program.  If not, see %3Chttp://www.gnu.org/licenses/%3E.%0A%0A
 from u2f
@@ -967,16 +967,201 @@
 ta'%0A%5D%0A%0A%0A
+class WithProps(object):%0A%0A    @property%0A    def getProps(self):%0A        return self.get('getProps', %5B%5D)%0A%0A    @property%0A    def setProps(self):%0A        return self.get('setProps', %7B%7D)%0A%0A%0A
 class Re
@@ -1440,32 +1440,43 @@
 nseData(JSONDict
+, WithProps
 ):%0A%0A    @propert
@@ -1572,166 +1572,8 @@
 %5D)%0A%0A
-    @property%0A    def getProps(self):%0A        return self.get('getProps', %5B%5D)%0A%0A    @property%0A    def setProps(self):%0A        return self.get('setProps', %7B%7D)%0A%0A
 %0Acla
@@ -1756,32 +1756,43 @@
 nseData(JSONDict
+, WithProps
 ):%0A%0A    @propert
@@ -1891,162 +1891,4 @@
 '%5D)%0A
-%0A    @property%0A    def getProps(self):%0A        return self.get('getProps', %5B%5D)%0A%0A    @property%0A    def setProps(self):%0A        return self.get('setProps', %7B%7D)%0A

Use a mixin for get-/setProps