Пример #1
0
    def _checkAuth(self):
        if current_user and current_user.is_authenticated and \
                not current_user.is_anonymous:
            privateKey = current_user.privateKey
            publicKey = current_user.publicKey

            if privateKey and publicKey:
                from astroprint.cloud import HMACAuth
                return HMACAuth(publicKey, privateKey)
        return None
Пример #2
0
	def _checkAuth(self):
		if current_user and current_user.is_authenticated():
			privateKey = current_user.privateKey
			publicKey = current_user.publicKey

			if self._settings.getBoolean(['software', 'useUnreleased']) and privateKey and publicKey:
				from astroprint.cloud import HMACAuth

				return HMACAuth(publicKey, privateKey)

		return None