Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
models.py39 linesDownload Raw Back to rfc8628
1import time2 3 4class DeviceCredentialMixin:5    def get_client_id(self):6        raise NotImplementedError()7 8    def get_scope(self):9        raise NotImplementedError()10 11    def get_user_code(self):12        raise NotImplementedError()13 14    def is_expired(self):15        raise NotImplementedError()16 17 18class DeviceCredentialDict(dict, DeviceCredentialMixin):19    def get_client_id(self):20        return self['client_id']21 22    def get_scope(self):23        return self.get('scope')24 25    def get_user_code(self):26        return self['user_code']27 28    def get_nonce(self):29        return self.get('nonce')30 31    def get_auth_time(self):32        return self.get('auth_time')33 34    def is_expired(self):35        expires_at = self.get('expires_at')36        if expires_at:37            return expires_at < time.time()38        return False39 
codekingpro/portable-devtools · Team Ai