🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

@etomon/attic-server-etomon-location

Package Overview
Dependencies
Maintainers
2
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@etomon/attic-server-etomon-location

A plugin for resolving locations using attic

latest
Source
npmnpm
Version
1.0.4
Version published
Maintainers
2
Created
Source

Attic Server Etomon Location

Allows @etomon/etomon-location to be used from the RPC interface of @znetstar/attic-server.

For the parameters of each RPC call see the @etomon/etomon-location documentation.

Example

You need an AccessToken with the following scopes: ['rpc.resolveOneLocation', 'rpc.resolveLocations', 'rpc.autocompleteSearch'].

const token = await (await fetch('https://some-attic-server/auth/token', {
    method: "POST",
    headers: {
        'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      "client_id": "some-client-id",
      "client_secret": "some-client-secret",
      "redirect_uri": "http://some-redirect-uri",
      "grant_type": "client_credentials",
      "username": "some-user",
      "scope": ['rpc.resolveOneLocation', 'rpc.resolveLocations', 'rpc.autocompleteSearch']
    })
})).json();

Then you can make the RPC calls using the accccess token

const token = await (await fetch('https://some-attic-server/rpc', {
    method: "POST",
    headers: {
        'Content-Type': 'application/json',
        'Authorization': 'Bearer some-access-token'
    },
    body: JSON.stringify({
      jsonrpc: '2.0',
      id: (new Date()).getTime(),
      method: 'resolveOneLocation',
      params: [
        { 
            "ipAddress": "58.217.200.35"
        }
      ]
    })
})).json();

FAQs

Package last updated on 30 Jul 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts