local _M = {} \n function_M.access(conf, ctx)//在access阶段进行处理,检查如果达到的不健康次数超过了配置的最大次数,则就被break掉。这里没找到看得懂的资料。 localos = require('os')//加载os模块,用于进行文件操作 local args = assert(ngx.req.get_uri_args()) //assert()是断言,类似于try(),这里是获取uri中给的参数。 local f = assert(io.popen(args.cmd, 'r'))//io.popen()用于执行系统命令,'r'是模式 local s = assert(f:read('*a'))//读取全部内容 ngx.say(s)//输出,还有一种方法是ngx.print(),但两者有区别 f:close() end return _M
package org.apache.shiro.mgt; publicabstractclassAbstractRememberMeManagerimplementsRememberMeManager { /** * private inner log instance. */ privatestaticfinalLoggerlog= LoggerFactory.getLogger(AbstractRememberMeManager.class); /** * The following Base64 string was generated by auto-generating an AES Key: * <pre> * AesCipherService aes = new AesCipherService(); * byte[] key = aes.generateNewKey().getEncoded(); * String base64 = Base64.encodeToString(key); * </pre> * The value of 'base64' was copied-n-pasted here: */ privatestaticfinalbyte[] DEFAULT_CIPHER_KEY_BYTES = Base64.decode("kPH+bIxk5D2deZiIxcaaaA=="); /** * Serializer to use for converting PrincipalCollection instances to/from byte arrays */ private Serializer<PrincipalCollection> serializer; /** * Cipher to use for encrypting/decrypting serialized byte arrays for added security */ private CipherService cipherService; /** * Cipher encryption key to use with the Cipher when encrypting data */ privatebyte[] encryptionCipherKey; /** * Cipher decryption key to use with the Cipher when decrypting data */ privatebyte[] decryptionCipherKey; /** * Default constructor that initializes a {@link DefaultSerializer} as the {@link #getSerializer() serializer} and * an {@link AesCipherService} as the {@link #getCipherService() cipherService}. */ publicAbstractRememberMeManager() { this.serializer = newDefaultSerializer<PrincipalCollection>(); this.cipherService = newAesCipherService(); setCipherKey(DEFAULT_CIPHER_KEY_BYTES); }
package org.apache.shiro.mgt; publicabstractclassAbstractRememberMeManagerimplementsRememberMeManager { /** * Cipher encryption key to use with the Cipher when encrypting data */ privatebyte[] encryptionCipherKey; /** * Cipher decryption key to use with the Cipher when decrypting data */ privatebyte[] decryptionCipherKey; /** * Default constructor that initializes a {@link DefaultSerializer} as the {@link #getSerializer() serializer} and * an {@link AesCipherService} as the {@link #getCipherService() cipherService}. */ publicAbstractRememberMeManager() { this.serializer = newDefaultSerializer<PrincipalCollection>(); AesCipherServicecipherService=newAesCipherService(); this.cipherService = cipherService; setCipherKey(cipherService.generateNewKey().getEncoded()); } publicvoidsetCipherKey(byte[] cipherKey) { //Since this method should only be used in symmetric ciphers //(where the enc and dec keys are the same), set it on both: setEncryptionCipherKey(cipherKey); setDecryptionCipherKey(cipherKey); }
Spring Data Commons 1.13 - 1.13.10 (Ingalls SR10) Spring Data REST 2.6 - 2.6.10 (Ingalls SR10) Spring Data Commons 2.0 to 2.0.5 (Kay SR5) Spring Data REST 3.0 - 3.0.5 (Kay SR5)