Added env var

This commit is contained in:
Douglas Barone 2020-12-03 16:10:20 -04:00
parent 008379f8e1
commit 3f1355c8b8
2 changed files with 15 additions and 13 deletions

View File

@ -38,6 +38,7 @@ CISCO_USER=serti.xx
CISCO_PASSWORD=senhadacontroladoracisco CISCO_PASSWORD=senhadacontroladoracisco
# Palo Alto # Palo Alto
PA_HOST=10.1.0.2
PA_USER=pti PA_USER=pti
PA_PASSWORD=senhadopaloaltocompermissaoparaapi PA_PASSWORD=senhadopaloaltocompermissaoparaapi
PA_NET=10.7. PA_NET=10.7.

View File

@ -29,24 +29,25 @@ async function updateUserIdMappings() {
await Promise.all( await Promise.all(
wifiDevices.map(async device => { wifiDevices.map(async device => {
const cmd = `
<uid-message>
<version>1.0</version>
<type>update</type>
<payload>
<login>
<entry name="ifms\\${device.user.sAMAccountName}" ip="${device.ip}" timeout="5">
</entry>
</login>
</payload>
</uid-message>
`
return axios.get( return axios.get(
'https://10.7.0.2/api/', `https://${process.env.PA_HOST}/api/`,
{ {
params: { params: {
type: 'user-id', type: 'user-id',
cmd: ` cmd
<uid-message>
<version>1.0</version>
<type>update</type>
<payload>
<login>
<entry name="ifms\\${device.user.sAMAccountName}" ip="${device.ip}" timeout="5">
</entry>
</login>
</payload>
</uid-message>
`
}, },
headers: { 'Content-Type': 'application/x-www-form-urlencoded' }, headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
httpsAgent: agent, httpsAgent: agent,