Skip to content
Snippets Groups Projects

Implement request signing and permitted domains

Merged Gospodin Bodurov requested to merge iframe-security into master
1 file
+ 11
1
Compare changes
  • Side-by-side
  • Inline
+ 11
1
@@ -76,6 +76,7 @@ func buildViamAPI() string {
keysLen := len(keys)
result += "function ViamAPI() {\n" +
" this.privateKey = \"\";\n" +
" this.config = {\n" +
" headers: {\n" +
" 'publicKey': '',\n" +
@@ -99,7 +100,16 @@ func buildViamAPI() string {
" this.config.headers.publicKey = window.btoa(authenticationPublicKey);\n" +
"};\n\n"
result += "ViamAPI.prototype.getConfig = function() {\n" +
result += "ViamAPI.prototype.setPrivateKey = function(privateKey) {\n" +
" this.privateKey = privateKey;\n" +
"};\n\n"
result += "ViamAPI.prototype.setPrivateKey = function(privateKey) {\n" +
" this.privateKey = privateKey;\n" +
"};\n\n"
result += "this.generateNonce = function() {\n" +
" var privateKey = config.privateKey;\n" +
" return this.config;\n" +
"};\n\n"
Loading