forked from firka/firka
fix: mock server fills grade links and keeps sessions across restarts
This commit is contained in:
1
mock_kreta_server/.gitignore
vendored
1
mock_kreta_server/.gitignore
vendored
@@ -1,2 +1,3 @@
|
||||
|
||||
mock_kreta_server
|
||||
auth.json
|
||||
|
||||
@@ -2,9 +2,39 @@ package main
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"time"
|
||||
)
|
||||
|
||||
func fillGradeBlanks(store *Store, grades []Grade) []Grade {
|
||||
groups := store.GetClassGroups()
|
||||
groupUid := ""
|
||||
subjectUid := ""
|
||||
if len(groups) > 0 {
|
||||
groupUid = groups[0].Uid
|
||||
}
|
||||
for _, g := range store.GetGrades() {
|
||||
if g.Tantargy.Uid != "" {
|
||||
subjectUid = g.Tantargy.Uid
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
for i := range grades {
|
||||
if grades[i].Uid == "" {
|
||||
grades[i].Uid = fmt.Sprintf("admin-%d-%d", time.Now().UnixNano(), i)
|
||||
}
|
||||
if grades[i].OsztalyCsoport.Uid == "" {
|
||||
grades[i].OsztalyCsoport.Uid = groupUid
|
||||
}
|
||||
if grades[i].Tantargy.Uid == "" {
|
||||
grades[i].Tantargy.Uid = subjectUid
|
||||
}
|
||||
}
|
||||
return grades
|
||||
}
|
||||
|
||||
func decodeBody(r *http.Request, v any) error {
|
||||
defer r.Body.Close()
|
||||
return json.NewDecoder(r.Body).Decode(v)
|
||||
@@ -74,7 +104,7 @@ func (s *Server) registerAdminRoutes(mux *http.ServeMux) {
|
||||
if err := decodeBody(r, &v); err != nil {
|
||||
return err
|
||||
}
|
||||
s.store.SetGrades(v)
|
||||
s.store.SetGrades(fillGradeBlanks(s.store, v))
|
||||
return nil
|
||||
},
|
||||
))
|
||||
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
"fmt"
|
||||
"log"
|
||||
"net/http"
|
||||
"os"
|
||||
"sync"
|
||||
"time"
|
||||
)
|
||||
@@ -38,24 +39,57 @@ func buildIdToken(instituteCode, userId, username, studentName string) string {
|
||||
}
|
||||
|
||||
type sessionInfo struct {
|
||||
instituteCode string
|
||||
userId string
|
||||
username string
|
||||
InstituteCode string `json:"instituteCode"`
|
||||
UserId string `json:"userId"`
|
||||
Username string `json:"username"`
|
||||
}
|
||||
|
||||
type AuthStore struct {
|
||||
mu sync.Mutex
|
||||
path string
|
||||
pendingCodes map[string]bool
|
||||
accessTokens map[string]sessionInfo
|
||||
refreshTokens map[string]sessionInfo
|
||||
}
|
||||
|
||||
func NewAuthStore() *AuthStore {
|
||||
return &AuthStore{
|
||||
type authFile struct {
|
||||
AccessTokens map[string]sessionInfo `json:"accessTokens"`
|
||||
RefreshTokens map[string]sessionInfo `json:"refreshTokens"`
|
||||
}
|
||||
|
||||
func NewAuthStore(path string) *AuthStore {
|
||||
a := &AuthStore{
|
||||
path: path,
|
||||
pendingCodes: map[string]bool{},
|
||||
accessTokens: map[string]sessionInfo{},
|
||||
refreshTokens: map[string]sessionInfo{},
|
||||
}
|
||||
raw, err := os.ReadFile(path)
|
||||
if err != nil {
|
||||
return a
|
||||
}
|
||||
var f authFile
|
||||
if json.Unmarshal(raw, &f) != nil {
|
||||
return a
|
||||
}
|
||||
if f.AccessTokens != nil {
|
||||
a.accessTokens = f.AccessTokens
|
||||
}
|
||||
if f.RefreshTokens != nil {
|
||||
a.refreshTokens = f.RefreshTokens
|
||||
}
|
||||
return a
|
||||
}
|
||||
|
||||
func (a *AuthStore) save() {
|
||||
raw, err := json.MarshalIndent(authFile{
|
||||
AccessTokens: a.accessTokens,
|
||||
RefreshTokens: a.refreshTokens,
|
||||
}, "", " ")
|
||||
if err != nil {
|
||||
return
|
||||
}
|
||||
os.WriteFile(a.path, raw, 0o644)
|
||||
}
|
||||
|
||||
func (a *AuthStore) issueCode() string {
|
||||
@@ -83,6 +117,7 @@ func (a *AuthStore) issueTokens(info sessionInfo) (string, string) {
|
||||
refresh := randomToken()
|
||||
a.accessTokens[access] = info
|
||||
a.refreshTokens[refresh] = info
|
||||
a.save()
|
||||
return access, refresh
|
||||
}
|
||||
|
||||
@@ -94,6 +129,7 @@ func (a *AuthStore) consumeRefresh(token string) (sessionInfo, bool) {
|
||||
return sessionInfo{}, false
|
||||
}
|
||||
delete(a.refreshTokens, token)
|
||||
a.save()
|
||||
return info, true
|
||||
}
|
||||
|
||||
@@ -158,9 +194,9 @@ func (s *Server) handleToken(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
info = sessionInfo{
|
||||
instituteCode: cfg.InstituteCode,
|
||||
userId: student.Uid,
|
||||
username: cfg.Username,
|
||||
InstituteCode: cfg.InstituteCode,
|
||||
UserId: student.Uid,
|
||||
Username: cfg.Username,
|
||||
}
|
||||
case "refresh_token":
|
||||
token := r.FormValue("refresh_token")
|
||||
@@ -178,9 +214,9 @@ func (s *Server) handleToken(w http.ResponseWriter, r *http.Request) {
|
||||
return
|
||||
}
|
||||
info = sessionInfo{
|
||||
instituteCode: cfg.InstituteCode,
|
||||
userId: student.Uid,
|
||||
username: cfg.Username,
|
||||
InstituteCode: cfg.InstituteCode,
|
||||
UserId: student.Uid,
|
||||
Username: cfg.Username,
|
||||
}
|
||||
default:
|
||||
w.WriteHeader(http.StatusBadRequest)
|
||||
@@ -188,7 +224,7 @@ func (s *Server) handleToken(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
access, refresh := s.auth.issueTokens(info)
|
||||
idToken := buildIdToken(info.instituteCode, info.userId, info.username, student.Nev)
|
||||
idToken := buildIdToken(info.InstituteCode, info.UserId, info.Username, student.Nev)
|
||||
|
||||
resp := map[string]any{
|
||||
"id_token": idToken,
|
||||
|
||||
@@ -106,11 +106,11 @@
|
||||
"SortIndex": 1
|
||||
},
|
||||
{
|
||||
"Uid": "",
|
||||
"Uid": "admin-1787903644593071178-1",
|
||||
"RogzitesDatuma": "2026-08-26T20:53:37.494Z",
|
||||
"KeszitesDatuma": "2026-08-26T20:53:37.494Z",
|
||||
"Tantargy": {
|
||||
"Uid": "",
|
||||
"Uid": "1,MATEK",
|
||||
"Nev": "meow",
|
||||
"Kategoria": {
|
||||
"Uid": "1",
|
||||
@@ -136,16 +136,16 @@
|
||||
"SzovegesErtek": "Jeles",
|
||||
"SulySzazalekErteke": 100,
|
||||
"OsztalyCsoport": {
|
||||
"Uid": ""
|
||||
"Uid": "10,11.A"
|
||||
},
|
||||
"SortIndex": 0
|
||||
},
|
||||
{
|
||||
"Uid": "",
|
||||
"Uid": "admin-1787903644593072300-2",
|
||||
"RogzitesDatuma": "2026-08-27T16:13:00.121Z",
|
||||
"KeszitesDatuma": "2026-08-27T16:13:00.121Z",
|
||||
"Tantargy": {
|
||||
"Uid": "",
|
||||
"Uid": "1,MATEK",
|
||||
"Nev": "meow",
|
||||
"Kategoria": {
|
||||
"Uid": "1",
|
||||
@@ -171,16 +171,16 @@
|
||||
"SzovegesErtek": "Jeles",
|
||||
"SulySzazalekErteke": 100,
|
||||
"OsztalyCsoport": {
|
||||
"Uid": ""
|
||||
"Uid": "10,11.A"
|
||||
},
|
||||
"SortIndex": 0
|
||||
},
|
||||
{
|
||||
"Uid": "",
|
||||
"Uid": "admin-1787903644593072591-3",
|
||||
"RogzitesDatuma": "2026-08-27T16:13:00.269Z",
|
||||
"KeszitesDatuma": "2026-08-27T16:13:00.269Z",
|
||||
"Tantargy": {
|
||||
"Uid": "",
|
||||
"Uid": "1,MATEK",
|
||||
"Nev": "meow",
|
||||
"Kategoria": {
|
||||
"Uid": "1",
|
||||
@@ -206,16 +206,16 @@
|
||||
"SzovegesErtek": "Jeles",
|
||||
"SulySzazalekErteke": 100,
|
||||
"OsztalyCsoport": {
|
||||
"Uid": ""
|
||||
"Uid": "10,11.A"
|
||||
},
|
||||
"SortIndex": 0
|
||||
},
|
||||
{
|
||||
"Uid": "",
|
||||
"Uid": "admin-1787903644593072771-4",
|
||||
"RogzitesDatuma": "2026-08-27T16:13:00.399Z",
|
||||
"KeszitesDatuma": "2026-08-27T16:13:00.399Z",
|
||||
"Tantargy": {
|
||||
"Uid": "",
|
||||
"Uid": "1,MATEK",
|
||||
"Nev": "meow",
|
||||
"Kategoria": {
|
||||
"Uid": "1",
|
||||
@@ -241,7 +241,427 @@
|
||||
"SzovegesErtek": "Jeles",
|
||||
"SulySzazalekErteke": 100,
|
||||
"OsztalyCsoport": {
|
||||
"Uid": ""
|
||||
"Uid": "10,11.A"
|
||||
},
|
||||
"SortIndex": 0
|
||||
},
|
||||
{
|
||||
"Uid": "9001",
|
||||
"RogzitesDatuma": "2026-08-27T22:01:29",
|
||||
"KeszitesDatuma": "2026-08-27T22:01:29",
|
||||
"Tantargy": {
|
||||
"Uid": "1,MATEK",
|
||||
"Nev": "meow",
|
||||
"Kategoria": {
|
||||
"Uid": "1",
|
||||
"Nev": "Kötelező",
|
||||
"Leiras": "Kötelező tantárgy"
|
||||
},
|
||||
"SortIndex": 1
|
||||
},
|
||||
"Tema": "friss jegy teszt",
|
||||
"Tipus": {
|
||||
"Uid": "1",
|
||||
"Nev": "Írásbeli",
|
||||
"Leiras": "Írásbeli felelet"
|
||||
},
|
||||
"ErtekFajta": {
|
||||
"Uid": "1",
|
||||
"Nev": "Osztályzat",
|
||||
"Leiras": "Osztályzat"
|
||||
},
|
||||
"ErtekeloTanarNeve": "mrrp",
|
||||
"Jelleg": "Ertekeles",
|
||||
"SzamErtek": 4,
|
||||
"SzovegesErtek": "Jó",
|
||||
"SulySzazalekErteke": 100,
|
||||
"OsztalyCsoport": {
|
||||
"Uid": "10,11.A"
|
||||
},
|
||||
"SortIndex": 1
|
||||
},
|
||||
{
|
||||
"Uid": "9002",
|
||||
"RogzitesDatuma": "2026-08-27T22:06:53",
|
||||
"KeszitesDatuma": "2026-08-27T22:06:53",
|
||||
"Tantargy": {
|
||||
"Uid": "1,MATEK",
|
||||
"Nev": "meow",
|
||||
"Kategoria": {
|
||||
"Uid": "1",
|
||||
"Nev": "Kötelező",
|
||||
"Leiras": "Kötelező tantárgy"
|
||||
},
|
||||
"SortIndex": 1
|
||||
},
|
||||
"Tema": "masodik teszt",
|
||||
"Tipus": {
|
||||
"Uid": "1",
|
||||
"Nev": "Írásbeli",
|
||||
"Leiras": "Írásbeli felelet"
|
||||
},
|
||||
"ErtekFajta": {
|
||||
"Uid": "1",
|
||||
"Nev": "Osztályzat",
|
||||
"Leiras": "Osztályzat"
|
||||
},
|
||||
"ErtekeloTanarNeve": "mrrp",
|
||||
"Jelleg": "Ertekeles",
|
||||
"SzamErtek": 5,
|
||||
"SzovegesErtek": "Jeles",
|
||||
"SulySzazalekErteke": 100,
|
||||
"OsztalyCsoport": {
|
||||
"Uid": "10,11.A"
|
||||
},
|
||||
"SortIndex": 1
|
||||
},
|
||||
{
|
||||
"Uid": "9101",
|
||||
"RogzitesDatuma": "2026-08-27T22:15:17",
|
||||
"KeszitesDatuma": "2026-08-27T22:15:17",
|
||||
"Tantargy": {
|
||||
"Uid": "1,MATEK",
|
||||
"Nev": "meow",
|
||||
"Kategoria": {
|
||||
"Uid": "1",
|
||||
"Nev": "Kötelező",
|
||||
"Leiras": "Kötelező tantárgy"
|
||||
},
|
||||
"SortIndex": 1
|
||||
},
|
||||
"Tema": "Fuggvenyek",
|
||||
"Tipus": {
|
||||
"Uid": "1",
|
||||
"Nev": "Írásbeli",
|
||||
"Leiras": "Írásbeli felelet"
|
||||
},
|
||||
"ErtekFajta": {
|
||||
"Uid": "1",
|
||||
"Nev": "Osztályzat",
|
||||
"Leiras": "Osztályzat"
|
||||
},
|
||||
"ErtekeloTanarNeve": "mrrp",
|
||||
"Jelleg": "Ertekeles",
|
||||
"SzamErtek": 5,
|
||||
"SzovegesErtek": "x",
|
||||
"SulySzazalekErteke": 100,
|
||||
"OsztalyCsoport": {
|
||||
"Uid": "10,11.A"
|
||||
},
|
||||
"SortIndex": 1
|
||||
},
|
||||
{
|
||||
"Uid": "9102",
|
||||
"RogzitesDatuma": "2026-08-27T22:15:18",
|
||||
"KeszitesDatuma": "2026-08-27T22:15:18",
|
||||
"Tantargy": {
|
||||
"Uid": "1,MATEK",
|
||||
"Nev": "meow",
|
||||
"Kategoria": {
|
||||
"Uid": "1",
|
||||
"Nev": "Kötelező",
|
||||
"Leiras": "Kötelező tantárgy"
|
||||
},
|
||||
"SortIndex": 1
|
||||
},
|
||||
"Tema": "Dolgozat",
|
||||
"Tipus": {
|
||||
"Uid": "1",
|
||||
"Nev": "Írásbeli",
|
||||
"Leiras": "Írásbeli felelet"
|
||||
},
|
||||
"ErtekFajta": {
|
||||
"Uid": "1",
|
||||
"Nev": "Osztályzat",
|
||||
"Leiras": "Osztályzat"
|
||||
},
|
||||
"ErtekeloTanarNeve": "mrrp",
|
||||
"Jelleg": "Ertekeles",
|
||||
"SzamErtek": 4,
|
||||
"SzovegesErtek": "x",
|
||||
"SulySzazalekErteke": 100,
|
||||
"OsztalyCsoport": {
|
||||
"Uid": "10,11.A"
|
||||
},
|
||||
"SortIndex": 1
|
||||
},
|
||||
{
|
||||
"Uid": "9103",
|
||||
"RogzitesDatuma": "2026-08-27T22:15:19",
|
||||
"KeszitesDatuma": "2026-08-27T22:15:19",
|
||||
"Tantargy": {
|
||||
"Uid": "1,MATEK",
|
||||
"Nev": "meow",
|
||||
"Kategoria": {
|
||||
"Uid": "1",
|
||||
"Nev": "Kötelező",
|
||||
"Leiras": "Kötelező tantárgy"
|
||||
},
|
||||
"SortIndex": 1
|
||||
},
|
||||
"Tema": "Felelet",
|
||||
"Tipus": {
|
||||
"Uid": "1",
|
||||
"Nev": "Írásbeli",
|
||||
"Leiras": "Írásbeli felelet"
|
||||
},
|
||||
"ErtekFajta": {
|
||||
"Uid": "1",
|
||||
"Nev": "Osztályzat",
|
||||
"Leiras": "Osztályzat"
|
||||
},
|
||||
"ErtekeloTanarNeve": "mrrp",
|
||||
"Jelleg": "Ertekeles",
|
||||
"SzamErtek": 3,
|
||||
"SzovegesErtek": "x",
|
||||
"SulySzazalekErteke": 100,
|
||||
"OsztalyCsoport": {
|
||||
"Uid": "10,11.A"
|
||||
},
|
||||
"SortIndex": 1
|
||||
},
|
||||
{
|
||||
"Uid": "9201",
|
||||
"RogzitesDatuma": "2026-08-27T22:26:04",
|
||||
"KeszitesDatuma": "2026-08-27T22:26:04",
|
||||
"Tantargy": {
|
||||
"Uid": "1,MATEK",
|
||||
"Nev": "meow",
|
||||
"Kategoria": {
|
||||
"Uid": "1",
|
||||
"Nev": "Kötelező",
|
||||
"Leiras": "Kötelező tantárgy"
|
||||
},
|
||||
"SortIndex": 1
|
||||
},
|
||||
"Tema": "Dolgozat",
|
||||
"Tipus": {
|
||||
"Uid": "1",
|
||||
"Nev": "Írásbeli",
|
||||
"Leiras": "Írásbeli felelet"
|
||||
},
|
||||
"ErtekFajta": {
|
||||
"Uid": "1",
|
||||
"Nev": "Osztályzat",
|
||||
"Leiras": "Osztályzat"
|
||||
},
|
||||
"ErtekeloTanarNeve": "mrrp",
|
||||
"Jelleg": "Ertekeles",
|
||||
"SzamErtek": 2,
|
||||
"SzovegesErtek": "Kettes",
|
||||
"SulySzazalekErteke": 100,
|
||||
"OsztalyCsoport": {
|
||||
"Uid": "10,11.A"
|
||||
},
|
||||
"SortIndex": 1
|
||||
},
|
||||
{
|
||||
"Uid": "9202",
|
||||
"RogzitesDatuma": "2026-08-27T22:26:05",
|
||||
"KeszitesDatuma": "2026-08-27T22:26:05",
|
||||
"Tantargy": {
|
||||
"Uid": "1,MATEK",
|
||||
"Nev": "meow",
|
||||
"Kategoria": {
|
||||
"Uid": "1",
|
||||
"Nev": "Kötelező",
|
||||
"Leiras": "Kötelező tantárgy"
|
||||
},
|
||||
"SortIndex": 1
|
||||
},
|
||||
"Tema": "Temazaro",
|
||||
"Tipus": {
|
||||
"Uid": "1",
|
||||
"Nev": "Írásbeli",
|
||||
"Leiras": "Írásbeli felelet"
|
||||
},
|
||||
"ErtekFajta": {
|
||||
"Uid": "1",
|
||||
"Nev": "Osztályzat",
|
||||
"Leiras": "Osztályzat"
|
||||
},
|
||||
"ErtekeloTanarNeve": "mrrp",
|
||||
"Jelleg": "Ertekeles",
|
||||
"SzamErtek": 1,
|
||||
"SzovegesErtek": "Egyes",
|
||||
"SulySzazalekErteke": 100,
|
||||
"OsztalyCsoport": {
|
||||
"Uid": "10,11.A"
|
||||
},
|
||||
"SortIndex": 1
|
||||
},
|
||||
{
|
||||
"Uid": "9301",
|
||||
"RogzitesDatuma": "2026-08-27T22:27:29",
|
||||
"KeszitesDatuma": "2026-08-27T22:27:29",
|
||||
"Tantargy": {
|
||||
"Uid": "1,MATEK",
|
||||
"Nev": "meow",
|
||||
"Kategoria": {
|
||||
"Uid": "1",
|
||||
"Nev": "Kötelező",
|
||||
"Leiras": "Kötelező tantárgy"
|
||||
},
|
||||
"SortIndex": 1
|
||||
},
|
||||
"Tema": "Rohamdolgozat",
|
||||
"Tipus": {
|
||||
"Uid": "1",
|
||||
"Nev": "Írásbeli",
|
||||
"Leiras": "Írásbeli felelet"
|
||||
},
|
||||
"ErtekFajta": {
|
||||
"Uid": "1",
|
||||
"Nev": "Osztályzat",
|
||||
"Leiras": "Osztályzat"
|
||||
},
|
||||
"ErtekeloTanarNeve": "mrrp",
|
||||
"Jelleg": "Ertekeles",
|
||||
"SzamErtek": 5,
|
||||
"SzovegesErtek": "Jeles",
|
||||
"SulySzazalekErteke": 100,
|
||||
"OsztalyCsoport": {
|
||||
"Uid": "10,11.A"
|
||||
},
|
||||
"SortIndex": 1
|
||||
},
|
||||
{
|
||||
"Uid": "9302",
|
||||
"RogzitesDatuma": "2026-08-27T22:27:30",
|
||||
"KeszitesDatuma": "2026-08-27T22:27:30",
|
||||
"Tantargy": {
|
||||
"Uid": "1,MATEK",
|
||||
"Nev": "meow",
|
||||
"Kategoria": {
|
||||
"Uid": "1",
|
||||
"Nev": "Kötelező",
|
||||
"Leiras": "Kötelező tantárgy"
|
||||
},
|
||||
"SortIndex": 1
|
||||
},
|
||||
"Tema": "Szodolgozat",
|
||||
"Tipus": {
|
||||
"Uid": "1",
|
||||
"Nev": "Írásbeli",
|
||||
"Leiras": "Írásbeli felelet"
|
||||
},
|
||||
"ErtekFajta": {
|
||||
"Uid": "1",
|
||||
"Nev": "Osztályzat",
|
||||
"Leiras": "Osztályzat"
|
||||
},
|
||||
"ErtekeloTanarNeve": "mrrp",
|
||||
"Jelleg": "Ertekeles",
|
||||
"SzamErtek": 4,
|
||||
"SzovegesErtek": "Jo",
|
||||
"SulySzazalekErteke": 100,
|
||||
"OsztalyCsoport": {
|
||||
"Uid": "10,11.A"
|
||||
},
|
||||
"SortIndex": 1
|
||||
},
|
||||
{
|
||||
"Uid": "admin-1787903644593072981-14",
|
||||
"RogzitesDatuma": "2026-08-28T07:50:02.769Z",
|
||||
"KeszitesDatuma": "2026-08-28T07:50:02.769Z",
|
||||
"Tantargy": {
|
||||
"Uid": "1,MATEK",
|
||||
"Nev": "meowfdg",
|
||||
"Kategoria": {
|
||||
"Uid": "1",
|
||||
"Nev": "Kötelező",
|
||||
"Leiras": ""
|
||||
},
|
||||
"SortIndex": 0
|
||||
},
|
||||
"Tema": "fasz",
|
||||
"Tipus": {
|
||||
"Uid": "1",
|
||||
"Nev": "Írásbeli",
|
||||
"Leiras": ""
|
||||
},
|
||||
"ErtekFajta": {
|
||||
"Uid": "1",
|
||||
"Nev": "Osztályzat",
|
||||
"Leiras": ""
|
||||
},
|
||||
"ErtekeloTanarNeve": "mrrpdfg",
|
||||
"Jelleg": "Ertekeles",
|
||||
"SzamErtek": 5,
|
||||
"SzovegesErtek": "Jeles",
|
||||
"SulySzazalekErteke": 100,
|
||||
"OsztalyCsoport": {
|
||||
"Uid": "10,11.A"
|
||||
},
|
||||
"SortIndex": 0
|
||||
},
|
||||
{
|
||||
"Uid": "admin-1787903983129659754-15",
|
||||
"RogzitesDatuma": "2026-08-28T07:57:39.668Z",
|
||||
"KeszitesDatuma": "2026-08-28T07:57:39.668Z",
|
||||
"Tantargy": {
|
||||
"Uid": "1,MATEK",
|
||||
"Nev": "meowfdg",
|
||||
"Kategoria": {
|
||||
"Uid": "1",
|
||||
"Nev": "Kötelező",
|
||||
"Leiras": ""
|
||||
},
|
||||
"SortIndex": 0
|
||||
},
|
||||
"Tema": "sdfsfd",
|
||||
"Tipus": {
|
||||
"Uid": "1",
|
||||
"Nev": "Írásbeli",
|
||||
"Leiras": ""
|
||||
},
|
||||
"ErtekFajta": {
|
||||
"Uid": "1",
|
||||
"Nev": "Osztályzat",
|
||||
"Leiras": ""
|
||||
},
|
||||
"ErtekeloTanarNeve": "meowfdg",
|
||||
"Jelleg": "Ertekeles",
|
||||
"SzamErtek": 5,
|
||||
"SzovegesErtek": "Jeles",
|
||||
"SulySzazalekErteke": 100,
|
||||
"OsztalyCsoport": {
|
||||
"Uid": "10,11.A"
|
||||
},
|
||||
"SortIndex": 0
|
||||
},
|
||||
{
|
||||
"Uid": "admin-1787903983129661557-16",
|
||||
"RogzitesDatuma": "2026-08-28T07:59:36.023Z",
|
||||
"KeszitesDatuma": "2026-08-28T07:59:36.023Z",
|
||||
"Tantargy": {
|
||||
"Uid": "1,MATEK",
|
||||
"Nev": "meowfdg",
|
||||
"Kategoria": {
|
||||
"Uid": "1",
|
||||
"Nev": "Kötelező",
|
||||
"Leiras": ""
|
||||
},
|
||||
"SortIndex": 0
|
||||
},
|
||||
"Tema": "fasz",
|
||||
"Tipus": {
|
||||
"Uid": "1",
|
||||
"Nev": "Írásbeli",
|
||||
"Leiras": ""
|
||||
},
|
||||
"ErtekFajta": {
|
||||
"Uid": "1",
|
||||
"Nev": "Osztályzat",
|
||||
"Leiras": ""
|
||||
},
|
||||
"ErtekeloTanarNeve": "meowfdg",
|
||||
"Jelleg": "Ertekeles",
|
||||
"SzamErtek": 5,
|
||||
"SzovegesErtek": "Jeles",
|
||||
"SulySzazalekErteke": 100,
|
||||
"OsztalyCsoport": {
|
||||
"Uid": "10,11.A"
|
||||
},
|
||||
"SortIndex": 0
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ func main() {
|
||||
|
||||
s := &Server{
|
||||
store: NewStore(*dataPath),
|
||||
auth: NewAuthStore(),
|
||||
auth: NewAuthStore("auth.json"),
|
||||
}
|
||||
|
||||
mux := http.NewServeMux()
|
||||
|
||||
Reference in New Issue
Block a user