묻고 답해요
158만명의 커뮤니티!! 함께 토론해봐요.
인프런 TOP Writers
-
해결됨[코드캠프] 부트캠프에서 만든 고농축 프론트엔드 코스
[section09] Quiz Ant-design DatePicker library
안녕하세요 section09 퀴즈에서 Ant-design Date picker 를 사용하는 과정에서 질문이 생겨 여쭤봅니다. import { DatePicker} from 'antd'; import type { DatePickerProps } from 'antd'; import { useState } from 'react'; export default function AndDesignPage() { const [date, setDate] = useState(''); const [month, setMonth] = useState(''); const onChange: DatePickerProps['onChange'] = (date, dateString) => { console.log(date); setDate(dateString); setMonth(date?.$M + 1);👈👈👈 1️⃣ }; return ( <> <h1>Q2. DatePicker</h1> <span> <DatePicker onChange={onChange} />👈👈👈 2️⃣ </span> {month && ( <> <p>선택날짜 : {date}</p> <p>{month}월을 선택하셨습니다.</p> </> )} </> ); } 전체 코드는 위와 같고 1️⃣,2️⃣번에 빨간 줄이 쳐졌습니다. 1️⃣번은 아래와 같은 메세지가 뜹니다.console.log(date)를 했을 때 아래와 같이 콘솔이 나와서 $M을 활용했는데 작동도 잘 되고 콘솔메세지에도 따로 에러가 뜨지는 않습니다. 2️⃣번은 아래와 같은 문제입니다에러메세지 전문은 다음과 같습니다.(alias) const DatePicker: PickerComponentClass<PickerProps<Dayjs> & { status?: "" | "warning" | "error" | undefined; hashId?: string | undefined; popupClassName?: string | undefined; rootClassName?: string | undefined; }, unknown> & { WeekPicker: import("./generatePicker/interface").PickerComponentClass<Omit<PickerProps<Dayjs> & { status?: "" | "warning" | "error" | undefined; hashId?: string | undefined; popupClassName?: string | undefined; rootClassName?: string | undefined; }, "picker">, unknown>; MonthPicker: import("./generatePicker/interface").PickerComponentClass<Omit<PickerProps<Dayjs> & { status?: "" | "warning" | "error" | undefined; hashId?: string | undefined; popupClassName?: string | undefined; rootClassName?: string | undefined; }, "picker">, unknown>; YearPicker: import("./generatePicker/interface").PickerComponentClass<Omit<PickerProps<Dayjs> & { status?: "" | "warning" | "error" | undefined; hashId?: string | undefined; popupClassName?: string | undefined; rootClassName?: string | undefined; }, "picker">, unknown>; RangePicker: import("./generatePicker/interface").PickerComponentClass<BaseRangePickerProps<Dayjs> & { dropdownClassName?: string | undefined; popupClassName?: string | undefined; }, unknown>; TimePicker: import("./generatePicker/interface").PickerComponentClass<Omit<Omit<import("rc-picker/lib/Picker").PickerTimeProps<Dayjs>, "locale" | "generateConfig" | "hideHeader" | "components" | "hourStep"> & { locale ... import DatePicker 'DatePicker' cannot be used as a JSX component. Its instance type 'Component<PickerProps<Dayjs> & { status?: "" | "warning" | "error" | undefined; hashId?: string | undefined; popupClassName?: string | undefined; rootClassName?: string | undefined; }, unknown, any> & CommonPickerMethods' is not a valid JSX element. The types returned by 'render()' are incompatible between these types. Type 'React.ReactNode' is not assignable to type 'import("/Users/bible/Bible_Highting/codecamp-frontend-bible/class_quiz/node_modules/@types/react-transition-group/node_modules/@types/react/index").ReactNode'. Type '{}' is not assignable to type 'ReactNode'.ts(2786) 1️⃣,2️⃣번 모두 작동에는 이상이 없으나 빨간줄의 원인과 해결방법을 알고싶어 질문드립니다. 감사합니다!
-
미해결
이벤트 어떻게 받나요?
3/8~3/21에 행사한 이벤트에서 로드맵 한 개를 구매하였고 3/28일에 혜택을 지급해준다 하였는데어디서 받는지 궁굼하여 이렇게 글을 올립니다.https://www.inflearn.com/pages/newsemester-230306?utm_source=kakao_friend&utm_medium=social&utm_campaign=traffic_new_user_chatbot&utm_content=20230314_&utm_term=0_MK
-
해결됨스프링부트 JUnit 테스트 - 시큐리티를 활용한 Bank 애플리케이션
변경된 시큐리티의 filterChain에서 and() 메서드 사용은 권장하지 않나요?
기존 상속 받아서 사용하던 것 처럼 변경된 filterChain에서도 and() 메서드를 사용해서 옵션들을 빌더 연결 패턴 처럼 사용할 수 있던데 변경된 시큐리티에선 권장하지 않는 방법인지, 아니면 가독성 때문인지 궁금합니다! @Bean public SecurityFilterChain filterChain(HttpSecurity http) throws Exception { log.debug("디버그: filterChain 빈 등록됨"); http.headers().frameOptions().disable() .and() .csrf().disable() .cors().configurationSource(configurationSource()) .and() .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS) .and() .formLogin().disable() .httpBasic().disable() .apply(new CustomSecurityFilterManager()) .and() .exceptionHandling().authenticationEntryPoint((request, response, authException) -> { CustomResponseUtil.fail(response, "로그인을 진행해 주세요", HttpStatus.UNAUTHORIZED); }) .and() .exceptionHandling().accessDeniedHandler((request, response, e) -> { CustomResponseUtil.fail(response, "권한이 없습니다", HttpStatus.FORBIDDEN); }) .and() .authorizeRequests() .antMatchers("/api/s/**").authenticated() .antMatchers("/api/admin/**").hasRole("" + UserEnum.ADMIN) .anyRequest().permitAll(); return http.build(); }
-
미해결10주완성 C++ 코딩테스트 | 알고리즘 코딩테스트
1-A 메모리 초과
안녕하세요 큰돌님.1-A문제를 makePermutation(재귀)을 통하여 작성해봤습니다.vector<int> v를 순서 섞기를 통하여 앞단의 7개 값의 합이 100인경우를 추려낸 다음, vector<int> ret에 memcpy를 통하여 복사를 진행하였습니다.결론적으로는 메모리 초과로 문제해결이 안되었는데, 합이 100인 1건의 사례에 대해서만 memcpy를 사용하였고, exit(0)를 통하여 프로그램을 종료하였는데 메모리 초과가 되는 이유를 모르겠습니다.한번 봐주시면 감사하겠습니다. <오답 - 메모리 초과>http://boj.kr/e8517aff3dde4152bf20a574308f7f76<정답 - 직접 작성>http://boj.kr/ce9f91b1272f4fe7beb54ddff446104c
-
해결됨스프링 입문 - 코드로 배우는 스프링 부트, 웹 MVC, DB 접근 기술
애플리케이션 런 했을때 에러 발생
학습하는 분들께 도움이 되고, 더 좋은 답변을 드릴 수 있도록 질문전에 다음을 꼭 확인해주세요.1. 강의 내용과 관련된 질문을 남겨주세요.2. 인프런의 질문 게시판과 자주 하는 질문(링크)을 먼저 확인해주세요.(자주 하는 질문 링크: https://bit.ly/3fX6ygx)3. 질문 잘하기 메뉴얼(링크)을 먼저 읽어주세요.(질문 잘하기 메뉴얼 링크: https://bit.ly/2UfeqCG)질문 시에는 위 내용은 삭제하고 다음 내용을 남겨주세요.=========================================[질문 템플릿]1. 강의 내용과 관련된 질문인가요? (예/아니오)2. 인프런의 질문 게시판과 자주 하는 질문에 없는 내용인가요? (예/아니오)3. 질문 잘하기 메뉴얼을 읽어보셨나요? (예/아니오)[질문 내용]여기에 질문 내용을 남겨주세요.안녕하세요 vs코드에서 자바 배우려고 intellj(무료버전)를 설치 후 강의를 따라가고 있습니다. 그런데 HelloSpringApplication을 런 했을때 3가지 에러가 발생하는데 핸들링 부탁드립니다.크게는 이 3가지가 나오고, 이건 첫번째 에러인데 해결하지 못했습니다 ㅠㅠ답변 부탁드립니다.
-
해결됨스프링 핵심 원리 - 기본편
test 쪽만 들어가면 앞에 이상한 코드가 잔뜩 들어가는데 도저히 수정을 못하겠습니다.
강사님 화면은 위쪽처럼 깔끔한데 저는 아래쪽에 DEBUG라는 메시지가 잔뜩 나옵니다. 여기저기 아무리 뒤져봐도 해결책을 찾지 못하고 있습니다. 설정 파일을 잘못 건드려서 그런걸까요?
-
해결됨토비의 스프링 부트 - 이해와 원리
회사 비지니스 공통업무처리 관련 유용한 라이브러리 들이 있는지 여쭤봅니다
안녕하세요 토비님~이번에도 강의 내용과 상관 없는 질문 드립니다회사에서 타임리프 + JPA + 마이바티스 + 스프링/스프링부트 + 오라클 환경에서 개발하고 있습니다 MVC CRUD, API 송수신, 특이업무를 제외하고는 보통 회사에서 일어나는 공통업무는 아래와 같은 부분이 있다고 생각 합니다*.엑셀다운*.엑셀업로드*.이메일전송(첨부파일포함)*.PDF다운*.FAX전송*.출력 다른 분들이 먼저 개발해 놓은 소스를 참고해 가며개발 수정 운영을 하고 있는데요 제가 느끼기에는 뭔가 불필요한 소스 코드가 많고 긴 건 아닐까?..누군가 잘 만들어 놓은 라이브러리 메서드에 파라미터만 담아주고호출 하면 되진 않을까 생각이 들었습니다 혹시, 아래와 같은 공통 업무 사항들에 대해서 스프링 진영에서 Util 성격으로 잘 만들어 미리 만들어 놓은 좋은 라이브러리가 있지는 않 을까 생각이 듭니다 (엑셀업로드,다운로드/이메일송수신/PDF/FAX/출력 .. )회사마다 환경이나 요구 상황에 따라서 다르겠지만, 토비님은 이런 공통 비지니스 업무 관련 엑셀업로드,다운로드/이메일송수신/PDF/FAX/출력 관련 공통 비지니스 업무 관련해서 스프링 진영에서 혹시 이미 만들어 놓은 라이브러리 의존 관계를 추가해서사용하고 계시는 부분이 있나 여쭤봅니다 만약 사용하고 계신다면 어떠 어떠한 것들이 있는지 소개 부탁 드립니다 급한 질문 아닙니 시간 나 실 때알려주시면 감사하겠습니다. 수고하세요.--█●●--------------------------------------------#엑셀#이메일#PDF#FAX#출력#스프링#스프링부트#부트#spring #sping-boot#springboot#토비#공통#라이브러리--█●●--------------------------------------------
-
해결됨10주완성 C++ 코딩테스트 | 알고리즘 코딩테스트
4-M stack으로 구현시 반례
안녕하세요 큰돌님~!http://boj.kr/c7f8555cf2714400bcd11b71d55d803d4-M 문제 stack으로 구현 해 보려구 도전 하다가 49% 에서 틀렸다고 나와서해당 로직의 반례가 발생할 수 있는 부분이 어디인지 피드백 받고자 질문드립니다.제가 구현하고자 했던 규칙은 이렇습니다.p가 i를 만나면 pop;k가 a를 만나면 pop;c가 h를 만나면 c를 pop하고 h를 push;h가 u를 만나면 (h를) pop;짝짓기 문제 같아서 stack을 떠올렷는데, 해설코드는 queue더라구요? 연습겸 stack을 사용한 구현도 완성하고 싶습니다!답변 주시면 감사하겠습니다.
-
해결됨[신규 개정판] 이것이 진짜 크롤링이다 - 실전편 (인공지능 수익화)
자바스크립트로 된 링크 가져오는 방법이 궁금합니다.
토요코인 수업 중에 위에 보는 것과 같이 자바스크립트로 링크가 걸려있는 경우 실제 url을 크롤링 하려면 어떻게 해야 하나요?
-
미해결[코드팩토리] [중급] Flutter 진짜 실전! 상태관리, 캐시관리, Code Generation, GoRouter, 인증로직 등 중수가 되기 위한 필수 스킬들!
마지막 강의보니 강의가 더나올거 같은데 언제 추가되나요?
보너스 강의가 약간 더 남았습니다~ 조금만 기다려주세요! Optimistic Response + Form + 글로벌 캐시관리를 한번에 보여주는 "리뷰 작성 페이지" 강의가 9월이 가기전에 추가될 계획입니다! 기대해주세요! (지금까지 배운 내용을 한번에 조합하는 강의입니다!)이렇게 글을 쓰셨던데 빨리 배워보고 싶네요 ㅠㅠ강의가 너무 좋아서 그런데 중급 이상강의 혹시 하나더 나올 계획은 없나요? 이 강의보단 조금더 복잡한... 너무 기다려집니다 ㅠㅠ 항상 감사합니다.
-
미해결스프링 시큐리티 OAuth2
Spring Authorization Server 1.0.1 state 문의
authorization_code grantType 으로 인가를 진행한다고 가 정하였을때 authorization_code 발급 요청에서 사용한 state 와 token 발급 요청해서 사용하는 state가 다르면 token 발급이 실패 해야 하는데 성공하고 있어서 분석해보니 oauth2_authorization 테이블의 state 필드가 null 로 저장되고 있습니다. JdbcOAuth2AuthorizationService를 사용하지 않고 커스텀한 구현체를 만들어서 사용하고 있는것이 원인일 수 있어 디버깅 해보니 OAuth2Authorization 의 소스를 분석해보면 state 가 포함되고 있지 않아서 저장이 안되고 있는데 아직 Spring Authorization Server는 state 가 구현되지 않은 걸까요? 추가로 소스를 분석해보니 nonce 도 아직 구현되지 않은거 같습니다.Spring Authorization Server 1.0.1 의 OAuth2Authorization 소스package org.springframework.security.oauth2.server.authorization; import java.io.Serializable; import java.time.Instant; import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Objects; import java.util.Set; import java.util.UUID; import java.util.function.Consumer; import org.springframework.lang.Nullable; import org.springframework.security.oauth2.core.AuthorizationGrantType; import org.springframework.security.oauth2.core.OAuth2AccessToken; import org.springframework.security.oauth2.core.OAuth2RefreshToken; import org.springframework.security.oauth2.core.OAuth2Token; import org.springframework.security.oauth2.server.authorization.client.RegisteredClient; import org.springframework.security.oauth2.server.authorization.util.SpringAuthorizationServerVersion; import org.springframework.util.Assert; import org.springframework.util.CollectionUtils; import org.springframework.util.StringUtils; /** * A representation of an OAuth 2.0 Authorization, which holds state related to the authorization granted * to a {@link #getRegisteredClientId() client}, by the {@link #getPrincipalName() resource owner} * or itself in the case of the {@code client_credentials} grant type. * * @author Joe Grandja * @author Krisztian Toth * @since 0.0.1 * @see RegisteredClient * @see AuthorizationGrantType * @see OAuth2Token * @see OAuth2AccessToken * @see OAuth2RefreshToken */ public class OAuth2Authorization implements Serializable { private static final long serialVersionUID = SpringAuthorizationServerVersion.SERIAL_VERSION_UID; private String id; private String registeredClientId; private String principalName; private AuthorizationGrantType authorizationGrantType; private Set<String> authorizedScopes; private Map<Class<? extends OAuth2Token>, Token<?>> tokens; private Map<String, Object> attributes; protected OAuth2Authorization() { } /** * Returns the identifier for the authorization. * * @return the identifier for the authorization */ public String getId() { return this.id; } /** * Returns the identifier for the {@link RegisteredClient#getId() registered client}. * * @return the {@link RegisteredClient#getId()} */ public String getRegisteredClientId() { return this.registeredClientId; } /** * Returns the {@code Principal} name of the resource owner (or client). * * @return the {@code Principal} name of the resource owner (or client) */ public String getPrincipalName() { return this.principalName; } /** * Returns the {@link AuthorizationGrantType authorization grant type} used for the authorization. * * @return the {@link AuthorizationGrantType} used for the authorization */ public AuthorizationGrantType getAuthorizationGrantType() { return this.authorizationGrantType; } /** * Returns the authorized scope(s). * * @return the {@code Set} of authorized scope(s) * @since 0.4.0 */ public Set<String> getAuthorizedScopes() { return this.authorizedScopes; } /** * Returns the {@link Token} of type {@link OAuth2AccessToken}. * * @return the {@link Token} of type {@link OAuth2AccessToken} */ public Token<OAuth2AccessToken> getAccessToken() { return getToken(OAuth2AccessToken.class); } /** * Returns the {@link Token} of type {@link OAuth2RefreshToken}. * * @return the {@link Token} of type {@link OAuth2RefreshToken}, or {@code null} if not available */ @Nullable public Token<OAuth2RefreshToken> getRefreshToken() { return getToken(OAuth2RefreshToken.class); } /** * Returns the {@link Token} of type {@code tokenType}. * * @param tokenType the token type * @param <T> the type of the token * @return the {@link Token}, or {@code null} if not available */ @Nullable @SuppressWarnings("unchecked") public <T extends OAuth2Token> Token<T> getToken(Class<T> tokenType) { Assert.notNull(tokenType, "tokenType cannot be null"); Token<?> token = this.tokens.get(tokenType); return token != null ? (Token<T>) token : null; } /** * Returns the {@link Token} matching the {@code tokenValue}. * * @param tokenValue the token value * @param <T> the type of the token * @return the {@link Token}, or {@code null} if not available */ @Nullable @SuppressWarnings("unchecked") public <T extends OAuth2Token> Token<T> getToken(String tokenValue) { Assert.hasText(tokenValue, "tokenValue cannot be empty"); for (Token<?> token : this.tokens.values()) { if (token.getToken().getTokenValue().equals(tokenValue)) { return (Token<T>) token; } } return null; } /** * Returns the attribute(s) associated to the authorization. * * @return a {@code Map} of the attribute(s) */ public Map<String, Object> getAttributes() { return this.attributes; } /** * Returns the value of an attribute associated to the authorization. * * @param name the name of the attribute * @param <T> the type of the attribute * @return the value of an attribute associated to the authorization, or {@code null} if not available */ @Nullable @SuppressWarnings("unchecked") public <T> T getAttribute(String name) { Assert.hasText(name, "name cannot be empty"); return (T) this.attributes.get(name); } @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null || getClass() != obj.getClass()) { return false; } OAuth2Authorization that = (OAuth2Authorization) obj; return Objects.equals(this.id, that.id) && Objects.equals(this.registeredClientId, that.registeredClientId) && Objects.equals(this.principalName, that.principalName) && Objects.equals(this.authorizationGrantType, that.authorizationGrantType) && Objects.equals(this.authorizedScopes, that.authorizedScopes) && Objects.equals(this.tokens, that.tokens) && Objects.equals(this.attributes, that.attributes); } @Override public int hashCode() { return Objects.hash(this.id, this.registeredClientId, this.principalName, this.authorizationGrantType, this.authorizedScopes, this.tokens, this.attributes); } /** * Returns a new {@link Builder}, initialized with the provided {@link RegisteredClient#getId()}. * * @param registeredClient the {@link RegisteredClient} * @return the {@link Builder} */ public static Builder withRegisteredClient(RegisteredClient registeredClient) { Assert.notNull(registeredClient, "registeredClient cannot be null"); return new Builder(registeredClient.getId()); } /** * Returns a new {@link Builder}, initialized with the values from the provided {@code OAuth2Authorization}. * * @param authorization the {@code OAuth2Authorization} used for initializing the {@link Builder} * @return the {@link Builder} */ public static Builder from(OAuth2Authorization authorization) { Assert.notNull(authorization, "authorization cannot be null"); return new Builder(authorization.getRegisteredClientId()) .id(authorization.getId()) .principalName(authorization.getPrincipalName()) .authorizationGrantType(authorization.getAuthorizationGrantType()) .authorizedScopes(authorization.getAuthorizedScopes()) .tokens(authorization.tokens) .attributes(attrs -> attrs.putAll(authorization.getAttributes())); } /** * A holder of an OAuth 2.0 Token and it's associated metadata. * * @author Joe Grandja * @since 0.1.0 */ public static class Token<T extends OAuth2Token> implements Serializable { private static final long serialVersionUID = SpringAuthorizationServerVersion.SERIAL_VERSION_UID; protected static final String TOKEN_METADATA_NAMESPACE = "metadata.token."; /** * The name of the metadata that indicates if the token has been invalidated. */ public static final String INVALIDATED_METADATA_NAME = TOKEN_METADATA_NAMESPACE.concat("invalidated"); /** * The name of the metadata used for the claims of the token. */ public static final String CLAIMS_METADATA_NAME = TOKEN_METADATA_NAMESPACE.concat("claims"); private final T token; private final Map<String, Object> metadata; protected Token(T token) { this(token, defaultMetadata()); } protected Token(T token, Map<String, Object> metadata) { this.token = token; this.metadata = Collections.unmodifiableMap(metadata); } /** * Returns the token of type {@link OAuth2Token}. * * @return the token of type {@link OAuth2Token} */ public T getToken() { return this.token; } /** * Returns {@code true} if the token has been invalidated (e.g. revoked). * The default is {@code false}. * * @return {@code true} if the token has been invalidated, {@code false} otherwise */ public boolean isInvalidated() { return Boolean.TRUE.equals(getMetadata(INVALIDATED_METADATA_NAME)); } /** * Returns {@code true} if the token has expired. * * @return {@code true} if the token has expired, {@code false} otherwise */ public boolean isExpired() { return getToken().getExpiresAt() != null && Instant.now().isAfter(getToken().getExpiresAt()); } /** * Returns {@code true} if the token is before the time it can be used. * * @return {@code true} if the token is before the time it can be used, {@code false} otherwise */ public boolean isBeforeUse() { Instant notBefore = null; if (!CollectionUtils.isEmpty(getClaims())) { notBefore = (Instant) getClaims().get("nbf"); } return notBefore != null && Instant.now().isBefore(notBefore); } /** * Returns {@code true} if the token is currently active. * * @return {@code true} if the token is currently active, {@code false} otherwise */ public boolean isActive() { return !isInvalidated() && !isExpired() && !isBeforeUse(); } /** * Returns the claims associated to the token. * * @return a {@code Map} of the claims, or {@code null} if not available */ @Nullable public Map<String, Object> getClaims() { return getMetadata(CLAIMS_METADATA_NAME); } /** * Returns the value of the metadata associated to the token. * * @param name the name of the metadata * @param <V> the value type of the metadata * @return the value of the metadata, or {@code null} if not available */ @Nullable @SuppressWarnings("unchecked") public <V> V getMetadata(String name) { Assert.hasText(name, "name cannot be empty"); return (V) this.metadata.get(name); } /** * Returns the metadata associated to the token. * * @return a {@code Map} of the metadata */ public Map<String, Object> getMetadata() { return this.metadata; } protected static Map<String, Object> defaultMetadata() { Map<String, Object> metadata = new HashMap<>(); metadata.put(INVALIDATED_METADATA_NAME, false); return metadata; } @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null || getClass() != obj.getClass()) { return false; } Token<?> that = (Token<?>) obj; return Objects.equals(this.token, that.token) && Objects.equals(this.metadata, that.metadata); } @Override public int hashCode() { return Objects.hash(this.token, this.metadata); } } /** * A builder for {@link OAuth2Authorization}. */ public static class Builder implements Serializable { private static final long serialVersionUID = SpringAuthorizationServerVersion.SERIAL_VERSION_UID; private String id; private final String registeredClientId; private String principalName; private AuthorizationGrantType authorizationGrantType; private Set<String> authorizedScopes; private Map<Class<? extends OAuth2Token>, Token<?>> tokens = new HashMap<>(); private final Map<String, Object> attributes = new HashMap<>(); protected Builder(String registeredClientId) { this.registeredClientId = registeredClientId; } /** * Sets the identifier for the authorization. * * @param id the identifier for the authorization * @return the {@link Builder} */ public Builder id(String id) { this.id = id; return this; } /** * Sets the {@code Principal} name of the resource owner (or client). * * @param principalName the {@code Principal} name of the resource owner (or client) * @return the {@link Builder} */ public Builder principalName(String principalName) { this.principalName = principalName; return this; } /** * Sets the {@link AuthorizationGrantType authorization grant type} used for the authorization. * * @param authorizationGrantType the {@link AuthorizationGrantType} * @return the {@link Builder} */ public Builder authorizationGrantType(AuthorizationGrantType authorizationGrantType) { this.authorizationGrantType = authorizationGrantType; return this; } /** * Sets the authorized scope(s). * * @param authorizedScopes the {@code Set} of authorized scope(s) * @return the {@link Builder} * @since 0.4.0 */ public Builder authorizedScopes(Set<String> authorizedScopes) { this.authorizedScopes = authorizedScopes; return this; } /** * Sets the {@link OAuth2AccessToken access token}. * * @param accessToken the {@link OAuth2AccessToken} * @return the {@link Builder} */ public Builder accessToken(OAuth2AccessToken accessToken) { return token(accessToken); } /** * Sets the {@link OAuth2RefreshToken refresh token}. * * @param refreshToken the {@link OAuth2RefreshToken} * @return the {@link Builder} */ public Builder refreshToken(OAuth2RefreshToken refreshToken) { return token(refreshToken); } /** * Sets the {@link OAuth2Token token}. * * @param token the token * @param <T> the type of the token * @return the {@link Builder} */ public <T extends OAuth2Token> Builder token(T token) { return token(token, (metadata) -> {}); } /** * Sets the {@link OAuth2Token token} and associated metadata. * * @param token the token * @param metadataConsumer a {@code Consumer} of the metadata {@code Map} * @param <T> the type of the token * @return the {@link Builder} */ public <T extends OAuth2Token> Builder token(T token, Consumer<Map<String, Object>> metadataConsumer) { Assert.notNull(token, "token cannot be null"); Map<String, Object> metadata = Token.defaultMetadata(); Token<?> existingToken = this.tokens.get(token.getClass()); if (existingToken != null) { metadata.putAll(existingToken.getMetadata()); } metadataConsumer.accept(metadata); Class<? extends OAuth2Token> tokenClass = token.getClass(); this.tokens.put(tokenClass, new Token<>(token, metadata)); return this; } protected final Builder tokens(Map<Class<? extends OAuth2Token>, Token<?>> tokens) { this.tokens = new HashMap<>(tokens); return this; } /** * Adds an attribute associated to the authorization. * * @param name the name of the attribute * @param value the value of the attribute * @return the {@link Builder} */ public Builder attribute(String name, Object value) { Assert.hasText(name, "name cannot be empty"); Assert.notNull(value, "value cannot be null"); this.attributes.put(name, value); return this; } /** * A {@code Consumer} of the attributes {@code Map} * allowing the ability to add, replace, or remove. * * @param attributesConsumer a {@link Consumer} of the attributes {@code Map} * @return the {@link Builder} */ public Builder attributes(Consumer<Map<String, Object>> attributesConsumer) { attributesConsumer.accept(this.attributes); return this; } /** * Builds a new {@link OAuth2Authorization}. * * @return the {@link OAuth2Authorization} */ public OAuth2Authorization build() { Assert.hasText(this.principalName, "principalName cannot be empty"); Assert.notNull(this.authorizationGrantType, "authorizationGrantType cannot be null"); OAuth2Authorization authorization = new OAuth2Authorization(); if (!StringUtils.hasText(this.id)) { this.id = UUID.randomUUID().toString(); } authorization.id = this.id; authorization.registeredClientId = this.registeredClientId; authorization.principalName = this.principalName; authorization.authorizationGrantType = this.authorizationGrantType; authorization.authorizedScopes = Collections.unmodifiableSet( !CollectionUtils.isEmpty(this.authorizedScopes) ? new HashSet<>(this.authorizedScopes) : new HashSet<>() ); authorization.tokens = Collections.unmodifiableMap(this.tokens); authorization.attributes = Collections.unmodifiableMap(this.attributes); return authorization; } } }
-
미해결노션사용법 - 조직이 노션을 쓰기 위해 알아야 할 모든 것
네이버 링크
안녕하십니까말씀하신대로https://www.naver.com/ 이렇게 했는데 create embed나 create bookmark 가 자동으로 뜨지 않습니다.
-
미해결
플러터 어뮬레이터 작동 안됩니다.
이렇게 안드로이드 스튜디오 안에서 어뮬레이터를 실행하면 실행에 이상이 없습니다. 이렇게 어뮬레이터만 밖에서 실행하거나 비쥬얼 스튜디오 코드에서 어뮬레이터 실행하면 어뮬레이터가 잘 돌아가지가 않습니다. 구글링 해서 문의했는데 전원 버튼을 누르거나 디바이스 'wipe data'도 했는데 똑같이 어뮬레이터가 실행이 안됩니다. 어떻게 해결해야 할까요?
-
해결됨스프링 핵심 원리 - 기본편
@Bean 설정 정보를 통한 빈 생명주기 콜백 등록 질문드립니다
@Configuration public class LifeCycleConfig { @Bean(initMethod = "init", destroyMethod = "close") public NetworkClient networkClient() { NetworkClient networkClient = new NetworkClient(); ... } }위와 같이 @Bean에 initMethod와 destroyMethod를 명시하여 빈 생명주기 콜백을 등록하는 방식에서, 중요한 장점으로 코드를 고칠 수 없는 외부 라이브러리에도 초기화, 종료 메서드를 적용할 수 있다는 점을 꼽아주셨습니다. 그런데 혹시 그게 어떻게 가능한가요?명시한 initMethod와 destroyMethod를 반환되는 빈 객체 내부 메소드에서 찾는 것 같은데, 그러면 그 외부 라이브러리 클래스 내부에 메서드를 작성해서 해당 메서드 명을 명시해주어야 할 필요가 있지 않은가요?아니면 혹시 해당 외부 라이브러리 클래스를 상속 받는 별도의 클래스를 작성한 뒤, 해당 클래스에 init, close 메소드를 구현한 뒤, 그 클래스를 빈으로 등록하는 방식일까요? 아니라면 어떤 식으로 등록할 수 있나요? 만약 상속해서 구현하는 방식이라면, InitializingBean, DisposableBean 인터페이스를 구현하는 방식도, 외부 라이브러리 클래스를 상속 받는 클래스를 작성한 뒤, 해당 클래스가 InitializingBean, DisposableBean을 구현하게끔 하고 그 클래스를 빈으로 등록하면 안되나요? (@PostConstruct와 @PreDestory로 등록하는 방식도 마찬가지로 외부 라이브러리 클래스를 상속 받은 뒤 구현할 수 없는 건가요?) 이러한 경우 어떠한 문제가 발생하나요? 직접 코드를 수정할 수 없는 외부 라이브러리에 빈 생명주기 콜백을 등록할 수 있는지 여부로 장단점이 나뉘었는데, 상속해서 등록하는 방식이라면 모두 다 가능하지 않은가 싶어서 질문 드리게 되었습니다. 잘못 이해한 부분이 있다면 알려주시면 감사드리겠습니다. 관련 강의'섹션 8. 빈 생명주기 콜백' - 빈 등록 초기화, 소멸 메서드
-
미해결[2025년 출제기준] 웹디자인기능사 실기시험 완벽 가이드
D,E이미니사이즈
안녕하세요 d,e타입 슬라이드 이미지 사이즈는 포토샵에서 몇으로 작업해야하는지 알 수 있을까요~??
-
미해결AWS Certified Advanced Networking - Specialty 자격증 준비하기
안녕하세요, 업데이트 문의드립니다.
현재 덤프 기준으로 문제풀이까지 업데이트 된 걸까요?최근 문제와는 일치하지 않아서 업데이트 이후에 다시 학습하려고 질문드립니다.
-
미해결[신규 개정판] 이것이 진짜 크롤링이다 - 기본편
PermissionError: [WinError 5] 액세스가 거부되었습니다
안녕하세요 강의에서 알려주신 내용 바탕으로 해보고 있는데 어느순간부터 'PermissionError: [WinError 5] 액세스가 거부되었습니다' 라는 메세지가 나옵니다.해당 메세지가 가르키는 줄을 보면 아래 코드중 service 부분에서 발생합니다. 어떻게 하면 수정할수있을지 도움말씀 부탁드립니다.service = Service(executable_path=ChromeDriverManager().install()) browser = webdriver.Chrome(service=service, options=chrome_options)
-
미해결Flutter 초입문 왕초보편
에뮬레이터 실행
왜 에러가 발생하죠? 코드분석하려고 실습파일을 가져와서 불러왔는데 에뮬레이터실행이 안됩니다
-
미해결나도코딩의 자바 기본편 - 풀코스 (20시간)
업로드 관련 문의
선생님, 안녕하세요 :)부트캠프 참여 전, 자바 개념을 잡기 위해 본 강의를 열심히 수강 중인 학생입니다.우선 양질의 강의 진행해 주심에 진심으로 감사드립니다! 더불어, 깃허브와 블로그에 학습 내용 정리와 관련하여 문의드립니다.해당 질문 관련 1월과 3월에 답변 주신 내용이 다소 상이하여 재문의 드리는 점 양해 부탁드리며,하기 조건에 유의할 경우 클래스 이후 강의까지 업로드 가능한지 궁금합니다.답변 기다리겠습니다, 감사합니다! :) 강의 내용을 응용한 코드를 작성해 깃허브와 블로그에 개인 복습용으로 업로드하고자 합니다.제가 아직 기초 단계인지라 강의 진행 흐름과 풀이 과정이 다소 유사할 수 있으나,클래스 강의부터는 제가 이해한 내용을 정리하는 차원에서 최대한 정제해 업로드할 예정입니다.'[Inflearn] 나도코딩의 자바 기본편' 출처를 필수 기재할 예정입니다.블로그의 경우, 이익 창출과 전혀 무관합니다.
-
미해결실전! 스프링 부트와 JPA 활용1 - 웹 애플리케이션 개발
test파일의 application.yml 내용 없는경우
test디렉토리의 resouces패키지를 만들고, 그 안에 application.yml 을 생성해서 인메모리모드를 보여주셨습니다.아무 코드가 없는 백지상태여도 인메모리모드로 돌아간다고 하셨는데요, 그래도 내용만 빌 뿐이지, 인메모리 환경을 위해서는 꼭 application.yml파일이 test디렉토리의 해당경로에 존재해야하는게 맞나요?