realm

Combining `by lazy` and `object` results in compiler-error “cannot find symbol”

落花浮王杯 提交于 2020-02-29 05:37:06
问题 I cannot compile anymore after the update to Kotlin 1.3.0 ( works in 1.2.71 ) when trying to use by lazy and object . This seems to happen only on my project. A demo-project is working fine. I want to add an interface to a given class and lazy-load its values. I've created a small example which is not working in my project but working fine in any other : open class Foo interface Bar { val lazyLoadedString : String } class Test { private val foo by lazy { object : Foo(), Bar { override val

Shiro -- (三) 自定义Realm

£可爱£侵袭症+ 提交于 2020-02-27 15:56:10
简介:   Realm:域,Shiro 从从 Realm 获取安全数据(如用户、角色、权限),就是说 SecurityManager 要验证用户身份,那么它需要从 Realm 获取相应的用户进行比较以确定用户身份是否合法;也需要从 Realm 得到用户相应的角色 / 权限进行验证用户是否能进行操作;可以把 Realm 看成 DataSource,即安全数据源。如我们之前的 ini 配置方式将使用 org.apache.shiro.realm.text. IniRealm 。 Realm源码: public interface Realm { String getName(); //返回一个唯一的Realm名字 boolean supports(AuthenticationToken var1); //判断此Realm是否支持此Token AuthenticationInfo getAuthenticationInfo(AuthenticationToken var1) throws AuthenticationException; //根据Token获取认证信息 } 一般继承 AuthorizingRealm (授权)即可;其继承了 AuthenticatingRealm(即身份验证),而且也间接继承了 CachingRealm(带有缓存实现)。其中主要默认实现如下:   org

How do I work with realm notification if result is updated after notification is initialized?

安稳与你 提交于 2020-02-27 13:00:09
问题 I use a UITableView with Realm results as it's data source. The results are registered with a realm notification and is updated very well when changes occur. However, the same table view has a search bar that filters the result based on the users search query. This also works fine, but if the notification listener recognizes an update, the section and row count does not match. What is the correct way to do this? Is it possible to update the NotificationToken? This is the code that initializes

How do I work with realm notification if result is updated after notification is initialized?

空扰寡人 提交于 2020-02-27 12:59:25
问题 I use a UITableView with Realm results as it's data source. The results are registered with a realm notification and is updated very well when changes occur. However, the same table view has a search bar that filters the result based on the users search query. This also works fine, but if the notification listener recognizes an update, the section and row count does not match. What is the correct way to do this? Is it possible to update the NotificationToken? This is the code that initializes

Shiro 项目应用 Shiro系列-Shiro简介

╄→尐↘猪︶ㄣ 提交于 2020-02-27 04:06:54
简单介绍   对于Shiro来说不仅可以使用到JavaSE的开发中,还可以使用到JavaEE的开发中,Shiro可以完成的工作有。认证、授权、加密、会话管理、与Web的集成、缓存等等操作,shiro 应用实例 www.1b23.com,在SpringBoot使用前端框架的时候就整合了Shiro并且与Thymeleaf整合的也是非常好。   下面就是关于Shiro简单的功能架构图 Authentication 身份认证/登录,验证用户是不是拥有相应的身份。 Authorization 授权,权限验证,验证某个已经认证的用户是否有某个权限,也就是判断用户是否能做什么样的事情。例如验证用户是否是某个角色 Session Manager 会话管理,也就是用户登录后就是一次会话,在没有退出之前,它的所有信息都在会话中,会话可以是普通的JavaSE会话,也可以是Web会话。 Cryptography 加密,保护数据的安全性,例如密码加密存储到数据库,而不是通过明文存储 Web Support Web支持,可以很容易的集成到Web环境中。 Caching 缓存,例如用户登录之后,其用户信息、用户角色权限等都不需要每次都进行查询。这样可以提高效率 Concurrency Shiro 支持多线程应用并发验证,即在一个线程中开启另一个线程能把权限自动传播过去; Testing 提供测试支持 Run

Springboot整合Shiro

不羁的心 提交于 2020-02-27 00:30:54
1.shiro核心API 2.整合 (1)导入依赖 < dependency > < groupId > org . apache . shiro < / groupId > < artifactId > shiro - spring < / artifactId > < version > 1.4 .0 < / version > < / dependency > (2)编写shiro配置类 自定义Realm类 @Configuration public class ShiroConfig { //创建ShiroFilterFactoryBean public ShiroFilterFactoryBean getShiroFilterFactoryBean ( @Qualifier ( "securityManager" ) DefaultWebSecurityManager securityManager ) { ShiroFilterFactoryBean shiroFilterFactoryBean = new ShiroFilterFactoryBean ( ) ; //设置安全管理器 shiroFilterFactoryBean . setSecurityManager ( securityManager ) ; return

2020-02-26

喜夏-厌秋 提交于 2020-02-26 23:46:00
庚子鼠年 戊寅月 戊寅日 描述 springboot练习 随笔 spring安全 shiro 添加shiro的内置过滤器 /admins/**=anon # 表示该 uri 可以匿名访问 /admins/**=auth # 表示该 uri 需要认证才能访问 /admins/**=authcBasic # 表示该 uri 需要 httpBasic 认证 /admins/**=perms[user:add:*] # 表示该 uri 需要认证用户拥有 user:add:* 权限才能访问 /admins/**=port[8081] # 表示该 uri 需要使用 8081 端口 /admins/**=rest[user] # 相当于 /admins/**=perms[user:method],其中,method 表示 get、post、delete 等 /admins/**=roles[admin] # 表示该 uri 需要认证用户拥有 admin 角色才能访问 /admins/**=ssl # 表示该 uri 需要使用 https 协议 /admins/**=user # 表示该 uri 需要认证或通过记住我认证才能访问 /logout=logout # 表示注销,可以当作固定配置 注意: anon,authcBasic,auchc,user 是认证过滤器。 perms,roles,ssl

Shiro -- (一)简介

坚强是说给别人听的谎言 提交于 2020-02-26 21:52:44
简介:   Apache Shiro 是一个强大易用的 Java 安全框架,提供了认证、授权、加密和会话管理等功能,对于任何一个应用程序,Shiro 都可以提供全面的安全管理服务。并且相对于其他安全框架,Shiro 要简单的多。 Authentication :身份认证 / 登录,验证用户是不是拥有相应的身份; Authorization :授权,即权限验证,验证某个已认证的用户是否拥有某个权限;即判断用户是否能做事情,常见的如:验证某个用户是否拥有某个角色。或者细粒度的验证某个用户对某个资源是否具有某个权限; Session Manager :会话管理,即用户登录后就是一次会话,在没有退出之前,它的所有信息都在会话中;会话可以是普通 JavaSE 环境的,也可以是如 Web 环境的; Cryptography :加密,保护数据的安全性,如密码加密存储到数据库,而不是明文存储; Web Support :Web 支持,可以非常容易的集成到 Web 环境; Caching :缓存,比如用户登录后,其用户信息、拥有的角色 / 权限不必每次去查,这样可以提高效率; Concurrency :shiro 支持多线程应用的并发验证,即如在一个线程中开启另一个线程,能把权限自动传播过去; Testing :提供测试支持; Run As :允许一个用户假装为另一个用户(如果他们允许

HTTP权威指南笔记

梦想与她 提交于 2020-02-26 10:46:15
HTTP权威指南笔记 第一部分、基本组成 一、HTTP报文 1.报文格式 报文的起始行和首部是以行分隔的,以回车换行CRLF进行结束。回车符ASCII码13,换行符ASCII码10. 请求报文格式 <method><request-URL><version> <headers> <entity-body> 响应报文格式 <version><status><reason-phrase> <headers> <entity-body> 2.HTTP方法 1)GET和HEAD被认为是安全方法 2)HEAD与GET方法的行为类似,但服务器在响应中只返回首部,不返回实体的主体部分。 HEAD可以用于判断资源类型,查看响应状态码(404是否存在等),资源是否被修改等。 3)PUT方法与GET相反,用于向服务器写入文档。让服务器用请求的主体部分创建一个由所请求的 URL命名的新文档。 4)POST用于向服务器输入数据,如表单数据。 5)TRACE请求,主要用于诊断网络,可以查看代理和其他应用程序对用户请求所产生的修改。 6)OPTIONS方法用于请求服务器支持哪些方法 7)DELETE方法,请求服务器删除所请求的资源。 3.HTTP首部 包括通用首部(客户端和服务器端都可以使用)、请求首部、响应首部、实体首部、扩展首部 1)通用信息首部 Connection 允许客户端和服务器指定与请求

Realm data doesn't show up on a physical device

你说的曾经没有我的故事 提交于 2020-02-26 03:19:24
问题 I'm developing an app with realmSwift. I want to set preset data on realm db initially, then I want it to show up when user open the app and to make it writable. I write some code based on other questions about realm bundle. such as Realm - Add file with initial data to project (iOS/Swift) and Realm fileExists is always true Then I managed to do what I want to on simulator but it doesn't work on a physical device. This is the code I wrote on AppDelegate func application(_ application: