mirror of
				https://github.com/h44z/wg-portal.git
				synced 2025-11-03 23:56:18 +00:00 
			
		
		
		
	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 <koetter@cispa.de>
This commit is contained in:
		@@ -28,7 +28,7 @@
 | 
			
		||||
        <div id="configContent" class="tab-content">
 | 
			
		||||
            <!-- server mode -->
 | 
			
		||||
            <div class="tab-pane fade {{if eq .Device.Type "server"}}active show{{end}}" id="server">
 | 
			
		||||
                <form method="post" enctype="multipart/form-data">
 | 
			
		||||
                <form method="post" enctype="multipart/form-data" name="server">
 | 
			
		||||
                    <input type="hidden" name="_csrf" value="{{.Csrf}}">
 | 
			
		||||
                    <input type="hidden" name="device" value="{{.Device.DeviceName}}">
 | 
			
		||||
                    <input type="hidden" name="devicetype" value="server">
 | 
			
		||||
@@ -162,7 +162,7 @@
 | 
			
		||||
 | 
			
		||||
            <!-- client mode -->
 | 
			
		||||
            <div class="tab-pane fade {{if eq .Device.Type "client"}}active show{{end}}" id="client">
 | 
			
		||||
                <form method="post" enctype="multipart/form-data">
 | 
			
		||||
                <form method="post" enctype="multipart/form-data" name="client">
 | 
			
		||||
                    <input type="hidden" name="_csrf" value="{{.Csrf}}">
 | 
			
		||||
                    <input type="hidden" name="device" value="{{.Device.DeviceName}}">
 | 
			
		||||
                    <input type="hidden" name="devicetype" value="client">
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user