What's the address of core whitelist contract? - nearprotocol

I'm trying to check if a given address is a potential validator on Near.
I understand that there is core whitelist contract that exposes a "isWhitelisted" method but I'm not sure how I can find it's address https://github.com/near/core-contracts/tree/master/whitelist

mainnet: lockup-whitelist.near
testnet: whitelist.f863973.m0

Related

How to know who created a specific kubernetes object

I'm actually curious to know is there any way to get the user who created a specific object in kubernetes. I am using kubernetes client-go library.
from my understanding kubernetes object doesn't hold any user-meta information. So how should I approach this ?
You can write a custom admission webhook which mutates the CRUD request for any object coming to kubernetes API server and add the user as a label to the object.This way you will always know who created the object by looking at that label. Also make sure to use validation admission webhook to reject any edit by the users to that label so that the information can not be changed or tampered.
Auditing describes the who, when and what: https://kubernetes.io/docs/tasks/debug-application-cluster/audit/. I think the way that you use it is to configure a logging backend which stores the logs and then allows you to query what happened.

How to store a private message in NEAR?

Are there any built-in mechanisms in NEAR for storing private messages, or does the contract need its own code for encrypting message contents?
does the contract need its own code for encrypting message contents?
Contract shouldn't be encrypting/decrypting messages, as everything executed on blockchain layer is visible to everyone.
However you can store already encrypted messages and do encryption/decryption client-side (i.e. in JS). Most convenient way to do this is use the same crypto library as used in nearlib:
https://tweetnacl.js.org/
There is no built-in way and right now contract has to handle encryption on their own. I think there will be more crypto function bindings introduced to runtime such as encryption, signature, etc in the future.

Google geocoding API security

I am asking this question after extensively reading Google's recommended approach, but I do have a problem with all these approaches, let me explain the situation.
I use combination of geolocation and geocoding API to know the approximate state location and then display relevant content. The geolocation API needs to be called obviously from the browser to get appropriate geolocation of the user. Google provides HTTP Referrer based restriction for this API. I know someone can easily spoof the referrer and make calls with the same API key. I do not see a huge advantage even though Google recommends this.
On the other hand Google does not allow HTTP Referrer for geocoding API, but it does allow that for the MAPS JavaScript API. But again if you are not using Google maps then using that API is violation of Google's terms. Now google recommends to move the code that uses geocoding web services API to be on the back-end so that your key will be protected. But since ultimately I need to deliver the result to a front-end web application that is publicly accessible and I can only make a browser based Ajax call to first get the geolocation to feed to geocoding, I ultimately need to make an Ajax call to get my geocoding information. Then someone can easily just latch onto my end-point to piggy back on and call the geocoding API as much as they want. So for situations like this I want to know what is the ideal and secured way to deal with. May be there are other APIs that might be an ideal situation for this.
In my case, I am not doing any maps so it's all purely server-side to get latitudes, longitudes and driving distance between two points. This today from Google support which might help and if you're using maps, then the links may provide further insight.
Regarding API restrictions, please note that HTTP referrers will not
work on Geocoding API since HTTP referrers can only be used for client
side services. In other words, Geocoding is a web service API and
should only be used on server-side implementation. IP address
restrictions should be used for web service APIs. However, if you are
using the Geocoding API in a website, IP address restriction would not
work. Please check the suitable restrictions for each API in the
following link:
https://developers.google.com/maps/api-key-best-practices#api_key_table
To make this work, you should create a separate key and use the new
one in your Geocoding API request URL. You may add a restriction to
this key by using an "API restriction", and restrict it to Geocoding
API only. If you don't want to create another key, you may keep using
your current one but make sure to change your implementation and use
the client side Geocoding service from the Maps JavaScript API. In
that case, please refer to this documentation:
https://developers.google.com/maps/documentation/javascript/geocoding
Another suggestion would be to get a static IP address from your ISP,
especially if you are planning to use it on a public website. For
development purposes, a sound solution would be to get three separate
keys: one for the staging and tests, another for server-side requests
and a third one for client-side requests. That way, you are making
sure your API key is protected.

Is there search-members helper in MailChimp v3?

I've been meaning to use MailChimp API, and since v3 is out already, I'd like to use it. I see there's a search-members helper like in v2 (https://apidocs.mailchimp.com/api/2.0/helper/search-members.php) and what is the endpoint for it?
If you want to get one spesific member by email address you can use this endpoint: Lists Members Instance
Not sure this is what you are looking for, but I was also looking for search-helper just to get one spesific user by email.
"But hey, how it happens, I dont have members id?"
Yes you do, if you have email address of that member you can create the id too. It's just MD5 Hash of lowercased version from that email address.
There is a search-members endpoint now on V3. I believe it was released after the original answer to this question:
http://developer.mailchimp.com/documentation/mailchimp/reference/search-members/
In case the link should change in the future it can be found under the main V3 MailChimp API documentation under the Search Members area.
No, searching members in this way isn't supported in API v3.0.

Does UPS Address Validation API works in mobile app?

I am learning UPS address validation API for my PHP application. Going to use web service version for my integration. However I am not sure whether UPS address validation will work for mobile app or not like iPhone or Android app. Can someone answer me this question in details?
Thanks in advance.
To add to Matt's comment, UPS address verification and official postal (e.g. USPS, Canada Post) addresses can be different so, in addition to the terms of service, make sure you are pulling from the right data.

Resources