forked from xtclang/platform
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Gene Gleyzer
committed
Aug 23, 2024
1 parent
b56c3d2
commit bd424ee
Showing
12 changed files
with
228 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import crypto.CryptoPassword; | ||
import crypto.KeyStore; | ||
|
||
|
||
/** | ||
* The proxy management API. | ||
*/ | ||
interface ProxyManager { | ||
|
||
/** | ||
* Send the proxy config updates updates to all proxies. | ||
* | ||
* @param keystore the keystore | ||
* @param pwd the password for the keystore | ||
* @param keyName the key name for the key/certificate pair | ||
* @param hostName the host name to be updated | ||
* @param report the function to report errors to | ||
*/ | ||
void updateProxyConfig(KeyStore keystore, CryptoPassword pwd, | ||
String keyName, String hostName, Reporting report); | ||
|
||
/** | ||
* Notify all proxies that a config needs to be removed. | ||
* | ||
* @param hostName the host name to be removed | ||
* @param report the function to report errors to | ||
*/ | ||
void removeProxyConfig(String hostName, Reporting report); | ||
|
||
/** | ||
* Trivial "do nothing" implementation. | ||
*/ | ||
static ProxyManager NoProxies = new ProxyManager() { | ||
construct() {} finally { makeImmutable(); } | ||
|
||
@Override | ||
void updateProxyConfig(KeyStore keystore, CryptoPassword pwd, | ||
String keyName, String hostName, Reporting report) {} | ||
|
||
@Override | ||
void removeProxyConfig(String hostName, Reporting report) {} | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
/* | ||
* Build the "proxy manager" module. | ||
*/ | ||
|
||
tasks.register("build") { | ||
val libDir = "${rootProject.projectDir}/lib" | ||
val srcModule = "${projectDir}/src/main/x/proxy.x" | ||
|
||
dependsOn(project(":common").tasks["build"]) | ||
|
||
project.exec { | ||
commandLine("xcc", | ||
"-o", libDir, | ||
"-L", libDir, | ||
srcModule) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/** | ||
* The proxy manager service. Eventually, this module should be moved to the | ||
*/ | ||
module proxy_manager.xqiz.it { | ||
package common import common.xqiz.it; | ||
|
||
package convert import convert.xtclang.org; | ||
package crypto import crypto.xtclang.org; | ||
package net import net.xtclang.org; | ||
package web import web.xtclang.org; | ||
|
||
/** | ||
* Bootstrapping: configure and return the ProxyManager. | ||
*/ | ||
common.ProxyManager configure(net.Uri[] receivers) { | ||
ProxyManager mgr = new ProxyManager(receivers); | ||
return &mgr.maskAs(common.ProxyManager); | ||
} | ||
} |
Oops, something went wrong.