Security Settings
📘Note:
The current security settings are only valid for the HTTP interface.
Allowlists
AllowList User-Agents
AllowList Origin
The URL schema (e.g., http://, https://) is optional in the allowlist entries. If a schema is included, requests must originate from an HTTP Origin with the same schema. An entry with a single schema will restrict requests to Origins matching that specific schema.
AllowList Contract Addresses
/v1/contracts/contract_address/events
/(event)|(events)/contract/contract_address
/(event)|(events)/contract/[a-zA-Z0-9]+/[a-zA-Z0-9]+
/(event)|(events)/contract/[a-zA-Z0-9]+/[a-zA-Z0-9]+/[a-zA-Z0-9]+
/walletsolidity/triggerconstantcontract
/wallet/triggersmartcontract
/wallet/triggerconstantcontract
JWT
Json Web Tokens (JWT) is an open standard for JSON to transfer claims between web application environments. JWT statements are generally used to pass authenticated user identity information between identity providers and service providers.
How to use JWT
If the JWT switch is on, each request needs to include token information for PolluxChain to verify. Requests that failed the verification will not be responded. Each account can create up to 3 JWTs. When creating a JWT, the public key created by the user is required (RS256 is now supported). ID and Fingerprint will be generated after the public key is filled in.
Example
In order to use JWT in the project, you need to generate a public/private key pair first. Pollux Chain currently supports the algorithm RS256. Please make sure you keep the private key secret!
-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvGek2v/H/TEzB+mnfbJ5
m7wgon0u/JjFQY3kYr6E0N4cRBQm8sy6ikNKi5x/1YxmhBqn6HvF9xD/p72eCBVe
RFh863pjWpF1C5yjOq3OEks00ayRP1ukATG8LtoUnWoPisXrh5/wVe4fHDPeNwe4
5RXOp6svO860o/ckAxt8yO/ZczqtN8cNA7unGawJ3cn8VeL+pa4a6f8DNfp32QUY
Y//HjPFvrTxcfJ4cM6E74L913P2CDuiSVVXMk0iyX/blh6M4h7dGAlcmHEHno9OW
5jrrAKobZZT1quc6qT43sTJviqc24Ndgas5jTOPhEV7bgkgQbTbtpgorHjUpqAIm
+wIDAQAB
-----END PUBLIC KEY-----
Method 1: Java code
Import the jjwt package
1.
2.
3.
{ "alg": "RS256",
"typ": "JWT",
"kid": "XXXXXXX" // id of jwt
}
4.
{
"exp": 1617736153,
"aud": "poxscan.io"
}
5.
6.