Skip to content
This repository has been archived by the owner on Sep 29, 2023. It is now read-only.

Merge develop with 2.2.0 back to master #61

Merged
merged 61 commits into from
Jun 28, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
2dc2dea
First draft for implementing a unified selectBone
phorward Nov 22, 2017
38b7694
replaced all selectOneBone references with the new selectBone
Nov 22, 2017
18cab25
Fixed ancient bug with multiple=True selectBones, now all works fine ;-)
phorward Nov 22, 2017
5641bf4
Added first implementation of a rate-limiting module
tsteinruecken Nov 23, 2017
184b42d
Added support for IPv6 Adresses
tsteinruecken Nov 28, 2017
b78c78d
Integrated review suggestions from @tsteinruecken.
phorward Nov 29, 2017
bdb502d
Introducing a keyBone
phorward Dec 13, 2017
3260316
More fixes from pr #32
phorward Dec 21, 2017
667b23e
Fixed a bug that may causes an skeleton defined in server to take pre…
tsteinruecken Feb 7, 2018
a082257
Use urlsafe_b64decode for filenames
tsteinruecken Feb 7, 2018
db92809
Completely defer the isindexed decision back to the bones and remove …
tsteinruecken Feb 7, 2018
979b8be
Remove old (non-multilang data) from entry in serialize()
tsteinruecken Feb 7, 2018
f1f06b0
Don't try to serialize a bone if it's not contained in valuesCache
tsteinruecken Feb 8, 2018
afab366
Merge branch 'develop' into fix/setUnindexedProperties
tsteinruecken Feb 8, 2018
40481f4
Merge pull request #43 from viur-framework/fix/setUnindexedProperties
tsteinruecken Feb 9, 2018
16022d4
Merge pull request #42 from viur-framework/fix/skeletonImport
tsteinruecken Feb 9, 2018
b6282e6
Merge pull request #41 from viur-framework/fix/decodingFileNames
tsteinruecken Feb 9, 2018
cbd01fe
Merge pull request #40 from viur-framework/fix/textBoneValueRestore
tsteinruecken Feb 9, 2018
e48f882
Merge pull request #39 from viur-framework/fix/skipMissingBonesInSeri…
tsteinruecken Feb 9, 2018
ca2abd8
Merge branch 'develop' into feature_keyBone
tsteinruecken Feb 9, 2018
ede507c
Merge branch 'develop' into feature/selectBone
tsteinruecken Feb 9, 2018
a2ac317
Merge branch 'develop' into feature/rateLimit
tsteinruecken Feb 15, 2018
f0a8ef2
Updated Documentation and removed debug output
tsteinruecken Feb 15, 2018
c83e6d0
Moved normalizeKey from unserialize/serialize to refresh in keyBone
tsteinruecken Feb 17, 2018
58df395
renderEntry() param parameter with default value
phorward Feb 28, 2018
7b844da
Merge pull request #46 from viur-framework/fix_renderEntry
tsteinruecken Feb 28, 2018
b8e0591
Merge pull request #45 from viur-framework/feature/rateLimit
tsteinruecken Mar 14, 2018
1e31ed9
Merge pull request #31 from viur-framework/feature_keyBone
tsteinruecken Mar 14, 2018
82aea88
Merge branch 'develop' into feature/selectBone
tsteinruecken Mar 14, 2018
2da5b20
Merge pull request #27 from viur-framework/feature/selectBone
tsteinruecken Mar 14, 2018
2dcdf71
Merge branch 'master' into develop
tsteinruecken Mar 19, 2018
e26c350
Updated changelog to reflect latest merges and fixes
tsteinruecken Mar 19, 2018
ecea2d1
Hotfix for PR #32
phorward Mar 21, 2018
8e4f5a4
Merge pull request #50 from viur-framework/hotfix_PR32
tsteinruecken Mar 21, 2018
89727c0
Bump Version for the 2.2.0 release
tsteinruecken Apr 4, 2018
c8cb590
fromClient() function for passwordBone and some code refactoring
phorward Apr 4, 2018
8ad34b6
Small extension
phorward Apr 4, 2018
2e7d898
Simplified fromClient function
phorward Apr 4, 2018
3b771aa
Updated README.md and CHANGELOG.md
phorward Apr 5, 2018
ba6d37b
Copyright year & header
phorward Apr 5, 2018
c57217b
fixed IndexError in textBone.getReferencedBlobs
skoegl Apr 11, 2018
5e98429
Made getSearchDocumentFields in numeric-Bone return an empty list if …
tsteinruecken Apr 11, 2018
1a6f2c3
fixed regression at handling selectbones in default html renderer - t…
skoegl Apr 12, 2018
a935a1e
Merge pull request #55 from viur-framework/hotfix/selectbone-regressi…
tsteinruecken Apr 13, 2018
09c0c13
Merge pull request #53 from viur-framework/hotfix/textBone.getReferen…
tsteinruecken Apr 13, 2018
0efb75c
Merge pull request #52 from viur-framework/refactor_passwordBone
tsteinruecken Apr 13, 2018
79e4fbe
Merge branch 'develop' into feature/updatedChangelog
tsteinruecken Apr 13, 2018
b8552e8
Updated changelog again; set expected RC-1 Release-Date to 17.04.2018
tsteinruecken Apr 13, 2018
7f2b2b6
Merge branch 'feature/updatedChangelog' of github.com:/viur-framework…
tsteinruecken Apr 13, 2018
4839bd4
Merge pull request #56 from viur-framework/fix/numericBoneReturnEmpty…
tsteinruecken Apr 14, 2018
de2f0fa
Fixed resolving the name property in prototypes/hierarchy:pathToKey
tsteinruecken Apr 14, 2018
d46738e
Return descriptions for selectBones translated also in Json-Render
tsteinruecken Apr 14, 2018
692de03
Prevent unserialize from booleanBone to fail if the database contains…
tsteinruecken Apr 14, 2018
3a00497
Merge pull request #57 from viur-framework/fix/translateSelectBonesIn…
tsteinruecken Apr 19, 2018
2457d47
Merge pull request #59 from viur-framework/fix/unserializeBooleanBone
tsteinruecken Apr 19, 2018
baff501
Updated changelog again; set new rc release date to today
tsteinruecken Apr 19, 2018
a7913da
Adjusting README and CHANGELOG over ViUR modules
phorward Apr 20, 2018
6e9d89d
Added Breaking flag
phorward Apr 23, 2018
7525df0
Codename: Etna
phorward Apr 23, 2018
3b600f9
Merge pull request #58 from viur-framework/fix/translatedNameResolveI…
tsteinruecken Apr 23, 2018
5178dc2
Merge pull request #51 from viur-framework/feature/updatedChangelog
tsteinruecken Apr 23, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 26 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,30 @@
# Changelog for the ViUR Server (https://github.com/viur-framework/server)
# Changelog

This file documents any relevant changes done to ViUR server since version 2.

## [2.2.0 Etna] - 2018-04-23

### Added
- A new Rate-Limit module that can be used to prevent DoS / Brute-Force on certain resources.
- New keyBone() class introduced for a better distinction between bones containing an entity key and those which don't.

### Changed
- Return descriptions in selectBones translated from our json render
- More descriptive error messages returned from password bone
- The new "params" Parameter introduced in 2.1.0 should now always have a default value (None)
- *[Breaking]*: Merged *selectOneBone* and *selectMultiBone* into a single *selectBone* which supports the multiple flag,
the previous bone names are still supported and cause a deprecation warning in the logs.

### Fixed
- Resolving the name of skeletons in prototypes/hierarchy when used on multi-lang bones
- Unserializing of booleanBones failed if the database contained a unicode string
- Several errors caused by None returned from getSearchDocumentFields / getSearchTags
- Exception causing ``toDB()`` to fail if a bone should be serialized which isn't in the valuesCache object. Fixes #7.
- Prevent text/string Bones from restoring old (non-multilang data) if set back to empty values. Fixes #6.
- Use urlsafe_b64decode for filename decoding (used by some old IE on WinXP). Fixes #38.
- Prevent skeleton from the server to take precedence over the ones defined in the application.
- The indexed-flag had been ignored on edit - causing all fields to be indexed. Fixes #34.

## [Unreleased]

## [2.1.0] - 2017-10-25

Expand Down Expand Up @@ -77,7 +100,7 @@
## [2.0.1] - 2017-01-04

### Added
- IDs of entries tranferred with dbtransfer are now marked as in-use inside the datastore
- IDs of entries transferred with dbtransfer are now marked as in-use inside the datastore
- conf["viur.cacheEnvironmentKey"] can now raise RuntimeError to indicate that this request cannot be cached
- Added the render attribute to BasicApplications

Expand Down
37 changes: 19 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,34 @@
# ViUR server

**ViUR** is a free software development framework for the [Google App Engine](https://appengine.google.com).
This is the main component of **ViUR**, a free software development framework for the [Google App Engine](https://appengine.google.com).

## About

ViUR provides a clear concept for implementing agile data management software that runs on top of the [Google App Engine](https://appengine.google.com) platform. It is written in the [Python programming language](https://python.org) for a maximum flexibility and easy-to-manage code. Its underlying database is Googles Cloud Datastore, which is a scalable document database.

The ViUR framework targets to the implementation of information systems, which are integrated, web-based applications or services performing data management and deployment operations of any kind. Therefore, ViUR is explicitly not claimed to be a content management system, although content management can be a part of a ViUR information system.

## Quick Start
## Getting started

To quickly setup a running ViUR web-application from scratch, follow these
simple steps:
Visit [viur.is](https://www.viur.is/) to get latest news and documentation on ViUR and how it is used.

1. Install the prerequisites Python and [Google Cloud SDK for Python](https://cloud.google.com/sdk) for your operating system.
To quickly setup a running ViUR web-application from scratch, follow these simple steps:

1. Install the prerequisites [Python 2.7](https://www.python.org/downloads/) and [Google Cloud SDK for Python](https://cloud.google.com/sdk) for your operating system.
2. Create an empty folder for your project.
3. Download setup.py from https://www.viur.is/package/download/setup/latest and save it into the newly created folder.
4. Run ``setup.py`` from that folder - it will do the rest for you!
5. Locally run the development server with ``dev_appserver.py -A <your-project-key> <project-dir>``
3. [Download setup.py](https://www.viur.is/package/download/setup/latest) and save it into the newly created folder.
4. Run ``python2 setup.py`` from that folder - it will do the rest for you!
5. Locally start the development server with ``dev_appserver.py -A <your-project-key> <project-dir>``
or deploy it to the world with ``gcloud app deploy --project <your-project-key> <your-project-dir>``.

All quick start steps as shell command snippet:
All quick start steps on a bash:

```sh
mkdir hello-viur # Setup project folder
cd hello-viur # Change into this folder
wget -qO setup.py https://www.viur.is/package/download/setup/latest # Download latest setup
python setup.py # Run ViUR setup tool
dev_appserver.py -A hello-viur . # Start Google App Engine
```bash
$ mkdir hello-viur # Setup project folder
$ cd hello-viur # Change into this folder
$ wget -qO setup.py https://www.viur.is/package/download/setup/latest # Download latest setup
$ python setup.py # Run ViUR setup tool
$ dev_appserver.py -A hello-viur . # Start Google App Engine
```

Visit the official [ViUR online documentation](https://docs.viur.is/latest) for more information.
Expand All @@ -36,9 +37,9 @@ Visit the official [ViUR online documentation](https://docs.viur.is/latest) for

We take a great interest in your opinion about ViUR. We appreciate your feedback and are looking forward to hear about your ideas. Share your visions or questions with us and participate in ongoing discussions.

- [ViUR on the web](https://www.viur.is)
- [ViUR website](https://www.viur.is)
- [#ViUR on freenode IRC](https://webchat.freenode.net/?channels=viur)
- [ViUR on Google Community](https://plus.google.com/communities/102034046048891029088)
- [ViUR on GitHub](https://github.com/viur-framework)
- [ViUR on Twitter](https://twitter.com/weloveViUR)

## Credits
Expand All @@ -49,7 +50,7 @@ Help of any kind to extend and improve or enhance this project in any kind or wa

## License

ViUR is Copyright (C) 2012-2017 by Mausbrand Informationssysteme GmbH.
Copyright (C) 2012-2018 by Mausbrand Informationssysteme GmbH.

Mausbrand and ViUR are registered trademarks of Mausbrand Informationssysteme GmbH.

Expand Down
4 changes: 2 additions & 2 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
I N F O R M A T I O N S Y S T E M

ViUR® SERVER
Copyright 2012-2017 by mausbrand Informationssysteme GmbH
Copyright 2012-2018 by mausbrand Informationssysteme GmbH

ViUR® is a free software development framework for the Google App Engine™.
More about ViUR can be found at http://www.viur.is/.
Expand All @@ -25,7 +25,7 @@
See file LICENSE for more information.
"""

__version__ = (2, 1, 0) # Which API do we expose to our application
__version__ = (2, 2, 0) # Which API do we expose to our application

import sys, traceback, os, inspect

Expand Down
4 changes: 2 additions & 2 deletions bones/__init__.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# -*- coding: utf-8 -*-

from server.bones.bone import baseBone, boneFactory
from server.bones.keyBone import keyBone
from server.bones.stringBone import stringBone
from server.bones.textBone import textBone
from server.bones.numericBone import numericBone
from server.bones.colorBone import colorBone
from server.bones.credentialBone import credentialBone
from server.bones.selectOneBone import selectOneBone
from server.bones.selectMultiBone import selectMultiBone, selectAccessMultiBone
from server.bones.selectBone import selectBone, selectOneBone, selectMultiBone, selectAccessBone
from server.bones.booleanBone import booleanBone
from server.bones.relationalBone import relationalBone
from server.bones.treeItemBone import treeItemBone
Expand Down
4 changes: 2 additions & 2 deletions bones/bone.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def __init__( self, descr="", defaultValue=None, required=False, params=None, mu
:type visible: bool

.. NOTE::
The kwarg 'multiple' is not supported by all bones (fe. selectOneBone)
The kwarg 'multiple' is not supported by all bones

"""
from server.skeleton import _boneCounter
Expand Down Expand Up @@ -179,7 +179,7 @@ def serialize( self, valuesCache, name, entity ):
:type name: String
:returns: dict
"""
if name != "key":
if name in valuesCache:
entity.set( name, valuesCache[name], self.indexed )
return( entity )

Expand Down
4 changes: 2 additions & 2 deletions bones/booleanBone.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

class booleanBone( baseBone ):
type = "bool"
trueStrs = [ str(True), "1", "yes" ]
trueStrs = [unicode(True), u"1", u"yes"]

@staticmethod
def generageSearchWidget(target,name="BOOLEAN BONE"):
Expand Down Expand Up @@ -72,7 +72,7 @@ def unserialize(self, valuesCache, name, expando):
"""
if name in expando:
val = expando[ name ]
if str( val ) in self.trueStrs:
if unicode(val) in self.trueStrs:
valuesCache[name] = True
else:
valuesCache[name] = False
Expand Down
18 changes: 18 additions & 0 deletions bones/keyBone.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# -*- coding: utf-8 -*-
from server.bones.bone import baseBone
from server.utils import normalizeKey

class keyBone(baseBone):
kind = "key"

def __init__(self, descr="Key", readOnly=True, visible=False, **kwargs):
super(keyBone, self).__init__(descr=descr, readOnly=readOnly, visible=visible, **kwargs)


def refresh(self, valuesCache, boneName, skel):
"""
Refresh all values we might have cached from other entities.
"""
if boneName in valuesCache and valuesCache[boneName]:
valuesCache[boneName] = normalizeKey(valuesCache[boneName])

3 changes: 3 additions & 0 deletions bones/numericBone.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ def fromClient( self, valuesCache, name, data ):


def serialize( self, valuesCache, name, entity ):
if not name in valuesCache:
return entity
if isinstance( valuesCache[name], float ) and valuesCache[name]!= valuesCache[name]: # NaN
entity.set( name, None, self.indexed )
else:
Expand Down Expand Up @@ -112,3 +114,4 @@ def buildDBFilter(self, name, skel, dbFilter, rawFilter, prefix=None):
def getSearchDocumentFields(self, valuesCache, name, prefix = ""):
if isinstance(valuesCache.get(name), int) or isinstance(valuesCache.get(name), float):
return [search.NumberField(name=prefix + name, value=valuesCache[name])]
return []
34 changes: 26 additions & 8 deletions bones/passwordBone.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
from server import utils
from server.bones import stringBone
from hashlib import sha256
import hmac
Expand Down Expand Up @@ -60,23 +61,40 @@ class passwordBone( stringBone ):
def isInvalid(self, value):
if not value:
return False
if len(value)<self.minPasswordLength:
return "Password to short"
# Run our passwort test suite

if len(value) < self.minPasswordLength:
return _("The entered password is to short - it requires at least {{length}} characters.",
length=self.minPasswordLength)

# Run our password test suite
testResults = []
for test in self.passwordTests:
testResults.append(test(value))
if sum(testResults)<self.passwordTestThreshold:
return("Your password isn't strong enough!")

if sum(testResults) < self.passwordTestThreshold:
return _("The entered password is too weak.")

return False

def fromClient( self, valuesCache, name, data ):
value = data.get(name)
if not value:
return "No value entered"

err = self.isInvalid(value)
if err:
return err

valuesCache[name] = value

def serialize( self, valuesCache, name, entity ):
if valuesCache.get(name,None) and valuesCache[name] != "":
salt = ''.join( [ random.choice(string.ascii_lowercase + string.ascii_uppercase + string.digits) for x in range(self.saltLength) ] )
salt = utils.generateRandomString(self.saltLength)
passwd = pbkdf2( valuesCache[name][ : conf["viur.maxPasswordLength"] ], salt )
entity.set( name, passwd, self.indexed )
entity.set( "%s_salt" % name, salt, self.indexed )
return( entity )

return entity

def unserialize( self, valuesCache, name, values ):
return( {name: ""} )
return {name: ""}
4 changes: 2 additions & 2 deletions bones/relationalBone.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,10 +241,10 @@ def serialize(self, valuesCache, name, entity ):
if self.indexed:
if refData:
for k, v in refData.items():
entity[ "%s.dest.%s" % (name,k) ] = v
entity.set("%s.dest.%s" % (name,k), v, True)
if usingData:
for k, v in usingData.items():
entity[ "%s.rel.%s" % (name,k) ] = v
entity.set("%s.rel.%s" % (name,k), v, True)
#for k, v in valuesCache[name].items():
# if (k in self.refKeys or any( [ k.startswith("%s." %x) for x in self.refKeys ] ) ):
# entity[ "%s.%s" % (name,k) ] = v
Expand Down
Loading