mirror of
				https://github.com/Telecominfraproject/wlan-cloud-ucentralsec.git
				synced 2025-10-30 02:12:32 +00:00 
			
		
		
		
	Signed-off-by: stephb9959 <stephane.bourque@gmail.com>
This commit is contained in:
		| @@ -54,7 +54,6 @@ namespace OpenWifi { | ||||
|  | ||||
|         SecretStore()->Remove(Key); | ||||
|         return OK(); | ||||
|  | ||||
|     } | ||||
|  | ||||
|     void RESTAPI_systemSecret_handler::DoPut() { | ||||
|   | ||||
| @@ -21,7 +21,7 @@ namespace OpenWifi { | ||||
|                                  Server, | ||||
|                                  TransactionId, | ||||
|                                  Internal) {} | ||||
|         static auto PathName() { return std::list<std::string>{"/systemSecret/{secret}"}; }; | ||||
|         static auto PathName() { return std::list<std::string>{"/api/v1/systemSecret/{secret}"}; }; | ||||
|         void DoGet() final; | ||||
|         void DoPost() final {}; | ||||
|         void DoDelete() final; | ||||
|   | ||||
| @@ -417,6 +417,38 @@ systeminfo() { | ||||
|     jq < ${result_file} | ||||
| } | ||||
|  | ||||
| getsecret() { | ||||
|     curl  ${FLAGS} -X GET "https://${OWSEC}/api/v1/systemSecret/${1}" \ | ||||
| 		-H "Content-Type: application/json" \ | ||||
| 		-H "Accept: application/json" \ | ||||
| 		-H "Authorization: Bearer ${token}" > ${result_file} | ||||
|     jq < ${result_file} | ||||
| } | ||||
|  | ||||
| getallsecrets() { | ||||
|     curl  ${FLAGS} -X GET "https://${OWSEC}/api/v1/systemSecret/0?all=true" \ | ||||
| 		-H "Content-Type: application/json" \ | ||||
| 		-H "Accept: application/json" \ | ||||
| 		-H "Authorization: Bearer ${token}" > ${result_file} | ||||
|     jq < ${result_file} | ||||
| } | ||||
|  | ||||
| setsecret() { | ||||
|     curl  ${FLAGS} -X PUT "https://${OWSEC}/api/v1/systemSecret/${1}?value=${2}" \ | ||||
| 		-H "Content-Type: application/json" \ | ||||
| 		-H "Accept: application/json" \ | ||||
| 		-H "Authorization: Bearer ${token}" > ${result_file} | ||||
|     jq < ${result_file} | ||||
| } | ||||
|  | ||||
| deletesecret() { | ||||
|     curl  ${FLAGS} -X DELETE "https://${OWSEC}/api/v1/systemSecret/${1}" \ | ||||
| 		-H "Content-Type: application/json" \ | ||||
| 		-H "Accept: application/json" \ | ||||
| 		-H "Authorization: Bearer ${token}" > ${result_file} | ||||
|     jq < ${result_file} | ||||
| } | ||||
|  | ||||
| reloadsubsystem() { | ||||
|     payload="{ \"command\" : \"reload\", \"subsystems\" : [ \"$1\" ] }" | ||||
|     curl  ${FLAGS} -X POST "https://${OWSEC}/api/v1/system" \ | ||||
| @@ -578,6 +610,10 @@ case "$1" in | ||||
|     "createapikey") login; createapikey "$2" ; logout;; | ||||
|     "deleteapikey") login; deleteapikey "$2" "$3"; logout;; | ||||
|     "getapikey") login; getapikey "$2" ; logout;; | ||||
|     "getsecret") login; getsecret "$2" ; logout;; | ||||
|     "getallsecrets") login; getallsecrets ; logout;; | ||||
|     "setsecret") login; setsecret "$2" "$3" ; logout;; | ||||
|     "deletesecret") login; deletesecret "$2" ; logout;; | ||||
|     "help") login; help  ; logout ;; | ||||
|     *) help ;; | ||||
| esac | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 stephb9959
					stephb9959