Этот коммит содержится в:
Ihar Hancharenka 2023-07-25 18:15:46 +03:00
родитель fe7ccaff22
Коммит 9813adc927
11 изменённых файлов: 133 добавлений и 0 удалений

6
pl/java/jvm/internals/instrument.txt Обычный файл
Просмотреть файл

@ -0,0 +1,6 @@
https://docs.oracle.com/en/java/javase/17/docs/api/java.instrument/java/lang/instrument/package-summary.html
https://docs.oracle.com/en/java/javase/17/docs/api/java.instrument/java/lang/instrument/Instrumentation.html
https://docs.oracle.com/en/java/javase/17/docs/api/java.instrument/java/lang/instrument/ClassFileTransformer.html
2023
https://habr.com/ru/articles/750028/

Просмотреть файл

@ -1,4 +1,7 @@
contract-testing
https://docs.spring.io/spring-cloud-contract/docs/current/reference/html/project-features.html
https://docs.spring.io/spring-cloud-contract/docs/current/reference/html/project-features.html#features-wiremock
https://www.infoq.com/minibooks/emag-testing-distributed-systems
https://spring.io/guides/gs/contract-rest/
https://docs.pact.io/readme

Просмотреть файл

@ -1,4 +1,5 @@
https://docs.spring.io/spring/docs/current/spring-framework-reference/core.html#core-convert
https://docs.spring.io/spring-framework/reference/web/webmvc/mvc-config/message-converters.html
core.convert.support.*

Просмотреть файл

@ -1,2 +1,4 @@
2023
https://vladmihalcea.com/soft-delete-jpa-version/
2022
https://www.baeldung.com/spring-jpa-soft-delete

2
pl/java/libfws/spring/rest/rest-client.txt Обычный файл
Просмотреть файл

@ -0,0 +1,2 @@
2023
https://spring.io/blog/2023/07/13/new-in-spring-6-1-restclient

1
pl/java/libfws/spring/rest/test.txt Обычный файл
Просмотреть файл

@ -0,0 +1 @@
https://docs.spring.io/spring-framework/reference/testing/spring-mvc-test-client.html

Просмотреть файл

@ -0,0 +1,43 @@
HttpSecurity http
http.oauth2Login()
adds OAuth2LoginAuthentionFilter
ClientRegistration (represents the client in OAuth2 arch) is also needed
- client_id
- client_secret
- grant_type
- scopes
ClientRegistration cr = ClientRegistration.withRegistrationId("github")
.clientId("...")
.clientSecret("...")
.scope(new String [] {"read:user"})
.authorizationUri("https://github.com/login/auth/authorize")
.tokenUri("https://github.com/login/auth/access_token")
.userInfoUri("https://api.github.com/user") // to get more details about user
.userNameAttributeId("id")
.clientName("GitHub")
.authorizationGrantType(AuthorizationGrantType.AUTHORIZATION_CODE)
.redirectUriTemplate("{baseUrl}/{action}/oauth2/code/{registrationId}")
.build();
https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/authorizing-oauth-apps
CommonOAuth2Provider - partially defines ClientRegistration
ClientRegistration cr = CommonOAuth2Provider.GITHUB
.getBuilder("github")
.clientId("...")
.clientSecret("...")
.build();
ClientRegistrationRepository bean (InMemory...) is used by OAuth2LoginAuthentionFilter ...
http.oauth2Login(c -> {
c.clientRegistrationRepository(...);
});
spring boot can fill OAuth2AuthenticationToken object to controller method params
props:
spring.security.oauth2.client.provider.myprovider.<prop-name>=<prop-val>

Просмотреть файл

@ -0,0 +1,33 @@
authorization code
client redirects user to login page
! the user is directly interacts with auth-server
response_type=code
client_id=<app-id>
redirect_uri=...
scope=<granted-authorities>
state=CSRF-token
the client redirects the user to auth-server
after successful auth, auth-server provides a code to client and state value
and the client can use this code later in order to obtain a token (access_token)
implicit grant type (not recommended)
to obtain a token without using a code
password
grant_type=password
scope
used only when client and auth-server are maintained by the same org
client credentials
grant_type=client_credentials
client_id
client_code
scope
simplest grant type,
we can use it when no user is involved
no refresh token
refresh token
grant_type=refresh_token
proof key code for code exchange (PKCE)
https://datatracker.ietf.org/doc/html/rfc7636

31
pl/java/libfws/spring/security/security.txt Обычный файл
Просмотреть файл

@ -0,0 +1,31 @@
https://github.com/spring-projects/spring-security
https://github.com/spring-projects/spring-security/tree/main/aspects/src/main/java/org/springframework/security/authorization/method/aspectj
config
https://github.com/spring-projects/spring-security/tree/main/config/src/main/java/org/springframework/security/config
https://github.com/spring-projects/spring-security/blob/main/config/src/main/java/org/springframework/security/config/annotation/web/builders/HttpSecurity.java
https://github.com/spring-projects/spring-security/tree/main/config/src/main/java/org/springframework/security/config/annotation/web/configurers
https://github.com/spring-projects/spring-security/tree/main/config/src/main/java/org/springframework/security/config/annotation/web/configurers/oauth2/client
https://github.com/spring-projects/spring-security/blob/main/config/src/main/java/org/springframework/security/config/annotation/web/configurers/oauth2/client/OAuth2LoginConfigurer.java
https://github.com/spring-projects/spring-security/blob/main/config/src/main/java/org/springframework/security/config/annotation/web/configurers/oauth2/server/resource/OAuth2ResourceServerConfigurer.java
https://github.com/spring-projects/spring-security/blob/main/config/src/main/java/org/springframework/security/config/oauth2/client/CommonOAuth2Provider.java
web
https://github.com/spring-projects/spring-security/tree/main/web/src/main/java/org/springframework/security/web
oaut2
https://github.com/spring-projects/spring-security/tree/main/oauth2
crypto
https://github.com/spring-projects/spring-security/tree/main/crypto/src/main/java/org/springframework/security/crypto
core
https://github.com/spring-projects/spring-security/tree/main/core/src/main/java/org/springframework/security
https://github.com/spring-projects/spring-security/blob/main/core/src/main/java/org/springframework/security/provisioning/JdbcUserDetailsManager.java
deprecated
TokenStore
https://github.com/search?q=repo%3Aspring-attic%2Fspring-security-oauth+TokenStore&type=code

Просмотреть файл

@ -0,0 +1,7 @@
https://wiremock.org
https://wiremock.org/docs/junit-jupiter/
https://docs.spring.io/spring-cloud-contract/docs/current/reference/html/project-features.html#features-wiremock
2022
https://vc.ru/u/628653-codeinside/535563-mock-servisy-dlya-testirovaniya-how-to-use-quick-start

Просмотреть файл

@ -1,3 +1,7 @@
https://crates.io/crates/regex
https://doc.rust-lang.org/regex/regex/index.html
https://github.com/rust-lang/regex
2023
https://blog.burntsushi.net/regex-internals/
https://habr.com/ru/articles/749730/