Fixes & API unit testing (#58)
* api - add OperationID

  helps when using pyswagger and is visible via
  http://localhost:8123/swagger/index.html?displayOperationId=true
  gin-swagger can not set displayOperationId yet

* api - match paramters to their property equivalents

  pascalcase & sometimes replacing the name (e.g. device -> DeviceName)

* api - use ShouldBindJSON instead of BindJSON

 BindJSON sets the content-type text/plain

* api - we renamed, we regenerated

* device - allow - in DeviceName wg-example0.conf etc

* api - more pascalcase & argument renames

* api - marshal DeletedAt as string

  gorm.DeletedAt is of type sql.NullTime
  NullTime declares Time & Valid as properties
  DeletedAt marshals as time.Time
  swaggertype allows only basic types
  -> string

* Peer - export UID/DeviceType in json
 UID/DeviceType is required, skipping in json, skips it in marshalling,
 next unmarshalling fails

* assets - name forms for use with mechanize

* api - match error message

* add python3/pyswagger based unittesting
 - initializes a clean install by configuration via web service
 - tests the rest api

* tests - test address exhaustion

* tests - test network expansion

Co-authored-by: Markus Koetter <[email protected]>
1 parent 93db475 commit 19c58fb5af7388a5228d2300e5747afa8259a36b
@commonism commonism authored on 30 Sep 2021
GitHub committed on 30 Sep 2021
Showing 10 changed files
View
README.md
View
assets/tpl/admin_edit_interface.html
View
assets/tpl/login.html
View
internal/server/api.go
View
internal/server/docs/docs.go
View
internal/users/user.go
View
internal/wireguard/peermanager.go
View
tests/conf/config.yml 0 → 100644
View
tests/conf/wg-example0.conf 0 → 100644
View
tests/test_API.py 0 → 100644