API for LOGIN / LOGOUT PLAYER - IPNS 5001 access control -
This commit is contained in:
parent
eb8ab6433b
commit
e31f00d0e4
30
API/SALT.sh
30
API/SALT.sh
|
@ -363,6 +363,32 @@ echo "" > ~/.zen/tmp/.ipfsgw.bad.twt # TODO move in 20h12.sh
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
##############################################
|
||||||
|
# LOGIN
|
||||||
|
##############################################
|
||||||
|
if [[ $APPNAME == "login" ]]; then
|
||||||
|
|
||||||
|
## REMOVE PLAYER IPNS KEY FROM STATION
|
||||||
|
PLAYER=${WHAT}
|
||||||
|
|
||||||
|
if [[ -d ~/.zen/game/players/${PLAYER}/ipfs ]]; then
|
||||||
|
|
||||||
|
ipfs key import ${PLAYER} -f pem-pkcs8-cleartext ~/.zen/tmp/coucou/${MOATS}.${G1PUB}.ipns.key
|
||||||
|
REP="LOGIN OK"
|
||||||
|
|
||||||
|
else
|
||||||
|
|
||||||
|
REP="ERROR UNKNOW ${PLAYER}"
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo ${REP}
|
||||||
|
echo "$HTTPCORS ${REP}"| nc -l -p ${PORT} -q 1 > /dev/null 2>&1 &
|
||||||
|
end=`date +%s`
|
||||||
|
echo $APPNAME "(☉_☉ ) Execution time was "`expr $end - $start` seconds.
|
||||||
|
exit 0
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
##############################################
|
##############################################
|
||||||
# LOGOUT
|
# LOGOUT
|
||||||
|
@ -376,7 +402,7 @@ echo "" > ~/.zen/tmp/.ipfsgw.bad.twt # TODO move in 20h12.sh
|
||||||
|
|
||||||
ipfs key rm ${G1PUB} > /dev/null 2>&1
|
ipfs key rm ${G1PUB} > /dev/null 2>&1
|
||||||
ipfs key rm ${PLAYER} > /dev/null 2>&1
|
ipfs key rm ${PLAYER} > /dev/null 2>&1
|
||||||
REP="OK"
|
REP="LOGOUT OK"
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
|
@ -398,7 +424,7 @@ echo "" > ~/.zen/tmp/.ipfsgw.bad.twt # TODO move in 20h12.sh
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## RESPONDING
|
## END RESPONDING
|
||||||
[[ ! -s ~/.zen/tmp/coucou/${MOATS}.index.redirect ]] && echo "$HTTPCORS PORT=$1 THAT=$2 AND=$3 THIS=$4 APPNAME=$5 WHAT=$6 OBJ=$7 VAL=$8 MOATS=$9" > ~/.zen/tmp/coucou/${MOATS}.index.redirect
|
[[ ! -s ~/.zen/tmp/coucou/${MOATS}.index.redirect ]] && echo "$HTTPCORS PORT=$1 THAT=$2 AND=$3 THIS=$4 APPNAME=$5 WHAT=$6 OBJ=$7 VAL=$8 MOATS=$9" > ~/.zen/tmp/coucou/${MOATS}.index.redirect
|
||||||
cat ~/.zen/tmp/coucou/${MOATS}.index.redirect | nc -l -p ${PORT} -q 1 > ~/.zen/tmp/coucou/${MOATS}.official.swallow &
|
cat ~/.zen/tmp/coucou/${MOATS}.index.redirect | nc -l -p ${PORT} -q 1 > ~/.zen/tmp/coucou/${MOATS}.official.swallow &
|
||||||
echo "HTTP 1.1 PROTOCOL DOCUMENT READY"
|
echo "HTTP 1.1 PROTOCOL DOCUMENT READY"
|
||||||
|
|
15
README.md
15
README.md
|
@ -114,14 +114,25 @@ GET /?salt=${SALT}&pepper=${PEPPER}&g1pub=${URLENCODEDURL}&email=${PLAYER}
|
||||||
|
|
||||||
### LOGOUT PLAYER (remove IPNS keys from Station)
|
### LOGOUT PLAYER (remove IPNS keys from Station)
|
||||||
```http
|
```http
|
||||||
GET /?salt=${SALT}&pepper=${PEPPER}&g1pub=${PLAYER}
|
GET /?salt=${SALT}&pepper=${PEPPER}&logout=${PLAYER}
|
||||||
```
|
```
|
||||||
|
|
||||||
| Parameter | Type | Description |
|
| Parameter | Type | Description |
|
||||||
| :-------- | :------- | :-------------------------------- |
|
| :-------- | :------- | :-------------------------------- |
|
||||||
| `salt` | `string` | **Required**. Your passphrase one token |
|
| `salt` | `string` | **Required**. Your passphrase one token |
|
||||||
| `pepper` | `string` | **Required**. Your passphrase two token |
|
| `pepper` | `string` | **Required**. Your passphrase two token |
|
||||||
| `g1pub` | `string` | **Required**. Your email one token |
|
| `logout` | `string` | **Required**. Your email one token |
|
||||||
|
|
||||||
|
### LOGIN PLAYER (Activate IPNS keys on Station)
|
||||||
|
```http
|
||||||
|
GET /?salt=${SALT}&pepper=${PEPPER}&login=${PLAYER}
|
||||||
|
```
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
| :-------- | :------- | :-------------------------------- |
|
||||||
|
| `salt` | `string` | **Required**. Your passphrase one token |
|
||||||
|
| `pepper` | `string` | **Required**. Your passphrase two token |
|
||||||
|
| `login` | `string` | **Required**. Your email one token |
|
||||||
|
|
||||||
|
|
||||||
### Lire Messagerie Gchange
|
### Lire Messagerie Gchange
|
||||||
|
|
Loading…
Reference in New Issue