Spaces:
Running
Running
Moibe
commited on
Commit
·
8de6f2c
1
Parent(s):
410cf6d
Will make user by app
Browse files- funciones.py +3 -2
- main.py +1 -5
- nycklar/nodes.py +3 -2
funciones.py
CHANGED
@@ -3,7 +3,7 @@ import tools
|
|
3 |
import avaimet
|
4 |
import globales
|
5 |
|
6 |
-
#Aquí van las funciones principales, las
|
7 |
#Las que interactuan con el servidor están en el módulo avaimet.
|
8 |
#Y las herramientas adicionales están en tools.
|
9 |
|
@@ -11,7 +11,8 @@ def getData():
|
|
11 |
#Genera conexión inicial.
|
12 |
sshListo, sftpListo = avaimet.conecta()
|
13 |
#Obtiene la caja donde está guardados los tokens.
|
14 |
-
|
|
|
15 |
dir_data = avaimet.obtenDireccionArchivo(globales.data)
|
16 |
#Obtiene el json con los datos.
|
17 |
data = avaimet.obtenContenidoArchivo(sftpListo, dir_data)
|
|
|
3 |
import avaimet
|
4 |
import globales
|
5 |
|
6 |
+
#Aquí van las funciones principales, las que son llamadas directo por la API.
|
7 |
#Las que interactuan con el servidor están en el módulo avaimet.
|
8 |
#Y las herramientas adicionales están en tools.
|
9 |
|
|
|
11 |
#Genera conexión inicial.
|
12 |
sshListo, sftpListo = avaimet.conecta()
|
13 |
#Obtiene la caja donde está guardados los tokens.
|
14 |
+
|
15 |
+
#globales.data es el archivo que queremos obtener.
|
16 |
dir_data = avaimet.obtenDireccionArchivo(globales.data)
|
17 |
#Obtiene el json con los datos.
|
18 |
data = avaimet.obtenContenidoArchivo(sftpListo, dir_data)
|
main.py
CHANGED
@@ -3,20 +3,16 @@ import funciones
|
|
3 |
|
4 |
app = FastAPI()
|
5 |
|
6 |
-
#Future: Correct warnings in cryptography.
|
7 |
-
|
8 |
@app.get("/")
|
9 |
def start():
|
10 |
-
|
11 |
return {"Status":"Deployed"}
|
12 |
|
13 |
## GET DATA ##
|
14 |
-
|
15 |
#Vía Path
|
16 |
@app.get("/getData/")
|
17 |
def getData():
|
18 |
data = funciones.getData()
|
19 |
-
print("Tipo de resultado:", type(data))
|
20 |
return data
|
21 |
|
22 |
#Vía Query
|
|
|
3 |
|
4 |
app = FastAPI()
|
5 |
|
|
|
|
|
6 |
@app.get("/")
|
7 |
def start():
|
|
|
8 |
return {"Status":"Deployed"}
|
9 |
|
10 |
## GET DATA ##
|
|
|
11 |
#Vía Path
|
12 |
@app.get("/getData/")
|
13 |
def getData():
|
14 |
data = funciones.getData()
|
15 |
+
#print("Tipo de resultado:", type(data))
|
16 |
return data
|
17 |
|
18 |
#Vía Query
|
nycklar/nodes.py
CHANGED
@@ -1,7 +1,8 @@
|
|
1 |
master = "moibe"
|
2 |
realm = "opal2.opalstack.com"
|
3 |
-
|
|
|
4 |
data = "/home/moibe/apps/holocards/sulku-data/"
|
5 |
key=b'kiSHsm7Y0hbyNdcFIav6OMT39gi29nIzT-rCrr0Tyc8='
|
6 |
#Ese usuario codificado lo podemos usar principalmente de ejemplo, ya no vienen de aquí, es oldballs.
|
7 |
-
user=b'gAAAAABmEZA4SLBC2YczouOrjIEi9WNCNGOIvyUcqBUnzxNsftXTdy54KaX9x8mAjFkABSI6FJrdZDQKk_5lpJOgJoMChxlniw=='
|
|
|
1 |
master = "moibe"
|
2 |
realm = "opal2.opalstack.com"
|
3 |
+
text_adition = "/sulkusers/"
|
4 |
+
avaimentekijä = "/home/moibe/apps/holocards" + text_adition
|
5 |
data = "/home/moibe/apps/holocards/sulku-data/"
|
6 |
key=b'kiSHsm7Y0hbyNdcFIav6OMT39gi29nIzT-rCrr0Tyc8='
|
7 |
#Ese usuario codificado lo podemos usar principalmente de ejemplo, ya no vienen de aquí, es oldballs.
|
8 |
+
#user=b'gAAAAABmEZA4SLBC2YczouOrjIEi9WNCNGOIvyUcqBUnzxNsftXTdy54KaX9x8mAjFkABSI6FJrdZDQKk_5lpJOgJoMChxlniw=='
|