소개
게시글
질문&답변
authentication server 토큰 검증 api 테스트 질문
anonymoususer 해결 방법은 어떻게 되나요?token에서 익명사용자로 확인이 된다는데, 해당 부분 관련되서는 제가 설정을 하지 않는 부분이 있을까요? 추가적으로 권한을 찾지 못하는 이유로는ClientSecretPostAuthenticationConverter에서 해당하는 파라미터가 없어서 발생하는 문제로 보입니다. ClientSecretPostAuthenticationConverter가 아닌 다른 설정을 했는지 질문드립니다. (강의 내용과 같은 버전을 사용하고 있습니다.) (사진)강의하고 다르게 파라미터를 넣었을 경우에는 해결이 되었습니다.
- 0
- 2
- 83
질문&답변
rsa 512 복호화 에러
@Bean public RSAKey rsaKey() throws JOSEException { return new RSAKeyGenerator(2048) .keyID("rsaKey") .algorithm(JWSAlgorithm.RS256) .generate(); }해당하는 설정을 변경을 하지 않아서 발생한 문제였습니다.혹시, 제가 빠뜨린 내용이 있을까요?rsaKeyGenerator algorithm을 자동으로 등록하기 위해 OAuth2ResourceServerJwtConfiguration에 있는 properties 값을 가지고 와서 등록하는 방법을 사용해야될까요?- 해당된 내용도 properties 설정에서 가져오면 좋겠다는 생각이 들어질문드립니다.
- 0
- 2
- 73
질문&답변
OAuth2 form login error
(사진)추가적으로 authentication에 값이 credentials가 빈값으로 오며, String presentedPassword = authentication.getCredentials().toString(); 해당코드를 통해 값이 빈값이라서 값이 없는 상황입니다.presentedPassword = ""userDetails.getPassword() = "{noop}1234"입니다.(사진)
- 0
- 2
- 93
질문&답변
needToCatchEvent 오류
네 디버깅하면서 logs가 안들어오는 것까지 확인을 했습니다.그런데 어디 부터 잘못되는지 확인이 불가능합니다.혹시 git에 소스코드 공유 부탁드려도 될까요?package event import ( "context" "event/config" "fmt" "math/big" "time" "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/common" ethType "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/ethclient" ) type Scan struct { config *config.Config FilterQuery ethereum.FilterQuery client *ethclient.Client } func NewScan(config *config.Config, client *ethclient.Client, catchEventList []common.Hash) (*Scan, chan []ethType.Log, error) { s := &Scan{ config: config, client: client, } eventLog := make(chan []ethType.Log, 100) scanCallection := common.HexToAddress("0x97D6Aba16E92d82A58519C452c006e4058A631D7") go s.lookingScan(config.Node.StartBlock, scanCallection, catchEventList, eventLog) return s, eventLog, nil } //44961870 // 배포 : 44961732 func (s *Scan) lookingScan(startBlock int64, scanCallection common.Address, catchEventList []common.Hash, eventLog chan uint64(startBlock) { fmt.Println("from Block", s.FilterQuery.ToBlock, "to Block", to) s.FilterQuery.ToBlock = big.NewInt(int64(to)) s.FilterQuery.FromBlock = big.NewInt(startReadtBlock) tryCount := 1 fmt.Println("s.FilterQuery : ", s.FilterQuery) Retry: if logs, err := s.client.FilterLogs(ctx, s.FilterQuery); err != nil { if tryCount == 3 { fmt.Println("failed to get Filter", "err", err.Error()) break } else { newTo := big.NewInt(int64(to) - 1) newFrom := big.NewInt(startBlock - 1) s.FilterQuery.ToBlock = newTo s.FilterQuery.FromBlock = newFrom tryCount++ goto Retry } } else if len(logs) > 0 { eventLog s.FilterQuery : { 44961732 52617540 [0x97D6Aba16E92d82A58519C452c006e4058A631D7] [[0xd99659a21de82e379975ce8df556f939a4ccb95e92144f38bb0dd35730ffcdd5]]}from Block 52617540 to Block 52617540s.FilterQuery : { 44961732 52617540 [0x97D6Aba16E92d82A58519C452c006e4058A631D7] [[0xd99659a21de82e379975ce8df556f939a4ccb95e92144f38bb0dd35730ffcdd5]]}from Block 52617540 to Block 52617541s.FilterQuery : { 44961732 52617541 [0x97D6Aba16E92d82A58519C452c006e4058A631D7] [[0xd99659a21de82e379975ce8df556f939a4ccb95e92144f38bb0dd35730ffcdd5]]}from Block 52617541 to Block 52617541s.FilterQuery : { 44961732 52617541 [0x97D6Aba16E92d82A58519C452c006e4058A631D7] [[0xd99659a21de82e379975ce8df556f939a4ccb95e92144f38bb0dd35730ffcdd5]]}from Block 52617541 to Block 52617542s.FilterQuery : { 44961732 52617542 [0x97D6Aba16E92d82A58519C452c006e4058A631D7] [[0xd99659a21de82e379975ce8df556f939a4ccb95e92144f38bb0dd35730ffcdd5]]}from Block 52617542 to Block 52617542s.FilterQuery : { 44961732 52617542 [0x97D6Aba16E92d82A58519C452c006e4058A631D7] [[0xd99659a21de82e379975ce8df556f939a4ccb95e92144f38bb0dd35730ffcdd5]]}exit status 0xc000013as.FilterQuery는 잘 들어오고 있는것 같은데 nil은 정상적인거죠?
- 0
- 3
- 338
질문&답변
needToCatchEvent 오류
package event import ( "context" "event/config" "event/types" "fmt" "github.com/ethereum/go-ethereum/common" ethType "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/crypto" "github.com/ethereum/go-ethereum/ethclient" ) type Catch struct { config *config.Config client *ethclient.Client needToCatchEvent map[common.Hash]types.NeedToCatchEvent } func NewCatch(config *config.Config, client *ethclient.Client) (*Catch, error) { c := &Catch{ config: config, client: client, } c.needToCatchEvent = map[common.Hash]types.NeedToCatchEvent{ common.BytesToHash(crypto.Keccak256([]byte("Transfer(address,address,uint256"))): { NeedToCatchEventFunc: c.Transfer, }, } return c, nil } func (c *Catch) Transfer(e *ethType.Log, tx *ethType.Transaction) { fmt.Println("들어 왔습니다.") } // start To Catch Event func (c *Catch) StartToCatch(events package app import ( "event/config" "event/event" repostory "event/repository" ethType "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/ethclient" ) type App struct { config *config.Config client *ethclient.Client repostory *repostory.Repostory scan *event.Scan catch *event.Catch } func NewApp(config *config.Config) { a := App{ config: config, } var err error if a.client, err = ethclient.Dial(config.Node.Uri); err != nil { panic(err) } else { if a.repostory, err = repostory.NewRepostory(config); err != nil { panic(err) } if a.catch, err = event.NewCatch(config, a.client); err != nil { panic(err) } var eventChan chan []ethType.Log if a.scan, eventChan, err = event.NewScan(config, a.client, a.catch.GetEventsToCatch()); err != nil { panic(err) } go a.catch.StartToCatch(eventChan) for { } } } 에러 코드는 없었습니다.트랜잭션을 전송하셨는지 질문을 드렸는데?mumbai에 트랜잭션을 말씀하신건가요? => 테스트넷에서 0x9f878a0a73a53dd676d4f9ec58b823ab9130df335c8b38b4df8ac2d15f49adee 검색할 수 있는 트랜잭션 해쉬 코드 입니다.실행 했을때의 로그입니다,Event가 들어 왔습니다.from Block to Block 52533290from Block 52533290 to Block 52533290from Block 52533290 to Block 52533291exit status 0xc000013a
- 0
- 3
- 338
질문&답변
create 요청시 에러
func (u *userRouter) create(c *gin.Context) { fmt.Println("create 입니다") var req types.CreateRequest if err := c.ShouldBindJSON(&req); err != nil { u.router.failedResponse(c, &types.CreateUserResponse{ ApiResponse: types.NewApiResponse(-1, "바인딩 오류", err), }) } else if err := u.userService.Create(req.ToUser()); err != nil { u.router.failedResponse(c, &types.CreateUserResponse{ ApiResponse: types.NewApiResponse(-1, "바인딩 오류", err), }) } else { u.router.okResponse(c, &types.CreateUserResponse{ ApiResponse: types.NewApiResponse(1, "성공 입니다.", err), }) } package typestype ApiResponse struct { Result int64 json:"result" Description string json:"description" ErrCode interface{} json:"errCode"}func NewApiResponse(Result int64, Description string, errCode interface{}) *ApiResponse { return &ApiResponse{ Result: Result, Description: Description, ErrCode: errCode, }} package typestype User struct { Name string json:"name" Age int64 json:"age"}type CreateUserResponse struct { *ApiResponse}type CreateRequest struct { Name string json:"name" binding:"require" Age int64 json:"age" binding:"require"}func (c CreateRequest) ToUser() User { return &User{ Name: c.Name, Age: c.Age, }}type GetUserResponse struct { *ApiResponse Users []*User json:result}type UpdateUserResponse struct { *ApiResponse}type UpdateRequest struct { Name string json:"name" binding:"require" UpdateAge int64 json:"updateAge" binding:"require"}type DeleteUserResponse struct { *ApiResponse}type DeleteRequest struct { Name string json:"name" binding:"require"}func (c DeleteRequest) ToUser() User { return &User{ Name: c.Name, }} 이렇게 되는데 if err := c.ShouldBindJSON(&req); err != nil { 여기서 문제가 발생했다고 합니다. 이유를 잘 모르겠습니다.
- 0
- 2
- 310
질문&답변
nosuchfile
https://github.com/yundongjun/untitled 관련 파일 입니다.
- 0
- 1
- 248
질문&답변
비대칭키 jwt 인증 문제
관련 내용에서 계속 안되서 질문 드립니다.
- 0
- 4
- 486
질문&답변
비대칭키 jwt 인증 문제
envApplicationReactiveWebEnvironment {activeProfiles=[], defaultProfiles=[default], propertySources=[MapPropertySource {name='server.ports'}, BootstrapPropertySource {name='bootstrapProperties-configClient'}, BootstrapPropertySource {name='bootstrapProperties-file:///C:\\Users\\ydj90\\Downloads\\git/file:C:\Users\ydj90\Downloads\git\ecommerce.yml'}, ConfigurationPropertySourcesPropertySource {name='configurationProperties'}, MapPropertySource {name='springCloudBusOverridesProperties'}, MapPropertySource {name='gateway-properties'}, PropertiesPropertySource {name='systemProperties'}, OriginAwareSystemEnvironmentPropertySource {name='systemEnvironment'}, RandomValuePropertySource {name='random'}, CachedRandomPropertySource {name='cachedrandom'}, MapPropertySource {name='springCloudClientHostInfo'}, OriginTrackedMapPropertySource {name='Config resource 'class path resource [application.yml]' via location 'optional:classpath:/''}, MapPropertySource {name='spring.integration.poller'}, MapPropertySource {name='springCloudBusDefaultProperties'}, OriginTrackedMapPropertySource {name='Config resource 'class path resource [bootstrap.yml]' via location 'optional:classpath:/''}, MapPropertySource {name='springCloudDefaultProperties'}, {name='Management Server'}]} propertySources[MapPropertySource {name='server.ports'}, BootstrapPropertySource {name='bootstrapProperties-configClient'}, BootstrapPropertySource {name='bootstrapProperties-file:///C:\\Users\\ydj90\\Downloads\\git/file:C:\Users\ydj90\Downloads\git\ecommerce.yml'}, ConfigurationPropertySourcesPropertySource {name='configurationProperties'}, MapPropertySource {name='springCloudBusOverridesProperties'}, MapPropertySource {name='gateway-properties'}, PropertiesPropertySource {name='systemProperties'}, OriginAwareSystemEnvironmentPropertySource {name='systemEnvironment'}, RandomValuePropertySource {name='random'}, CachedRandomPropertySource {name='cachedrandom'}, MapPropertySource {name='springCloudClientHostInfo'}, OriginTrackedMapPropertySource {name='Config resource 'class path resource [application.yml]' via location 'optional:classpath:/''}, MapPropertySource {name='spring.integration.poller'}, MapPropertySource {name='springCloudBusDefaultProperties'}, OriginTrackedMapPropertySource {name='Config resource 'class path resource [bootstrap.yml]' via location 'optional:classpath:/''}, MapPropertySource {name='springCloudDefaultProperties'}, {name='Management Server'}] user-service.yml spring: datasource: url: jdbc:h2:mem:testdb driver-class-name: org.h2.Driver generate-unique-name: false username: '{cipher}AQBZT1bZyyKdYnWBMbh5LSjRUV+5wt50pt9WClGg+hSu7ARkvke3ndRUX0zhI8GOCfn/bJUMS1wXKz/XjpPlILkarebYyMi7iE6czM0cNC3cj1ZsH2lyk2NVcfuWutAIUCxJutsPw4zx079JJ/Alg81ycnHewmBMWofVIfcn+RWkCwkANQkv/xljQUL2w9xLgFnpBAv2tL3fjwgfQBPFbJhg/711JYmZyP0vWIISlWhyj/IebG7DcJGA0HdTu2RMdiY7oy1sez7MyyOWue8AuwGF8ll6j4qNG/1bapmooF+c/O8SYSp4fV3IgBF1q9LHgsszl9dRfqlFiUYI/q0zHViG97gamN39Qm1/B8H9eyfz+KtWrgWQnLrlXCEsAxdg/8M='token: expiration_time: 864000000 secret: '{cipher}AQCwCy3C26G+3di+9nxOgu2Dvb0jKOagWvPFRcsoeL5wGwId5zdxovCE/UOmMzxfm0oTmzLBr2j9I1gJvZtMtZ27lwgHlRjnZKai0bxrP9QEk5Uvwxb7mzzIYwnyRjCynIPNmxO399rZNMnb7WtTLz61lj9Nc8e4ijUgA4HfT1n+No6pIYBX2HdO3DLFPHQmCedusFCwJ4QsFVHfV/XRnnE6+AM6Sfjh6+8t1N2UxNZYPygUr2aueY1tTaHgZ1iz4uh6zT0X74fdwOCcDNIfBWwTcDpQChP3KEtfqK8XpWr6uf4r4/47ZShThPAS4ZvwCqtQmfnTL8kpH5AA2G8DgEPyVSZy8eU4oJWc83ebv/Nrbr+CMhe513/OcQpMli1D2Y4='gateway: ip: 172.30.1.33order_service: url: http://order-service/order-service/%s/orders exception: order_is_empty: User's orders is emptyuser-service => bootstrap.ymlspring: cloud: config: uri: http://localhost:8888 name: user-service # profiles: # active: devecommerce.ymltoken: expiration_time: 864000000 secret: '{cipher}AQCwCy3C26G+3di+9nxOgu2Dvb0jKOagWvPFRcsoeL5wGwId5zdxovCE/UOmMzxfm0oTmzLBr2j9I1gJvZtMtZ27lwgHlRjnZKai0bxrP9QEk5Uvwxb7mzzIYwnyRjCynIPNmxO399rZNMnb7WtTLz61lj9Nc8e4ijUgA4HfT1n+No6pIYBX2HdO3DLFPHQmCedusFCwJ4QsFVHfV/XRnnE6+AM6Sfjh6+8t1N2UxNZYPygUr2aueY1tTaHgZ1iz4uh6zT0X74fdwOCcDNIfBWwTcDpQChP3KEtfqK8XpWr6uf4r4/47ZShThPAS4ZvwCqtQmfnTL8kpH5AA2G8DgEPyVSZy8eU4oJWc83ebv/Nrbr+CMhe513/OcQpMli1D2Y4='gateway: ip: 172.30.1.33 apigateway-service => bootstrap.ymlspring: cloud: config: uri: http://localhost:8888 name: ecommerce
- 0
- 4
- 486
질문&답변
jwt 관련 질문입니다.
감사합니다.
- 0
- 2
- 1.6K