Resolve "Populate main branch with initial commit (Release 0)"

Closes #3 (closed)

Merge request reports

Loading
+643

File added.

Preview size limit exceeded, changes collapsed.

+479

File added.

Preview size limit exceeded, changes collapsed.

+50
Changes for src/main/java/portal/api/config/ActiveMQComponentConfig.java: 50 added lines, 0 removed lines.
Original line number Diff line number Diff line
/*-
 * ========================LICENSE_START=================================
 * org.etsi.osl.portal.api
 * %%
 * Copyright (C) 2019 openslice.io
 * %%
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * =========================LICENSE_END==================================
 */
package portal.api.config;

import jakarta.jms.ConnectionFactory;

import org.apache.camel.component.activemq.ActiveMQComponent;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.jms.core.JmsTemplate;
import org.springframework.stereotype.Component;

@Configuration
@Component
public class ActiveMQComponentConfig {



	@Bean(name = "activemq")
    public ActiveMQComponent createComponent(ConnectionFactory factory) {
        ActiveMQComponent activeMQComponent = new ActiveMQComponent();
        activeMQComponent.setConnectionFactory(factory);
        return activeMQComponent;
    }
    
    @Bean(name = "jmsTemplate")
	public JmsTemplate jmsTemplate(ConnectionFactory factory){
	    JmsTemplate template = new JmsTemplate();
	    template.setConnectionFactory( factory );
	    return template;
	}
   
}
+35
Changes for src/main/java/portal/api/config/BCryptPasswordEncoderConfig.java: 35 added lines, 0 removed lines.
Original line number Diff line number Diff line
/*-
 * ========================LICENSE_START=================================
 * org.etsi.osl.portal.api
 * %%
 * Copyright (C) 2019 openslice.io
 * %%
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * =========================LICENSE_END==================================
 */
package portal.api.config;


import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;


@Configuration
public class BCryptPasswordEncoderConfig {

    @Bean
    public BCryptPasswordEncoder passwordEncoder() {
        return new BCryptPasswordEncoder();
    }
}
+37
Changes for src/main/java/portal/api/config/CustomClaimVerifier.java: 37 added lines, 0 removed lines.
Original line number Diff line number Diff line
/*-
 * ========================LICENSE_START=================================
 * org.etsi.osl.portal.api
 * %%
 * Copyright (C) 2019 openslice.io
 * %%
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *      http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * =========================LICENSE_END==================================
 */
package portal.api.config;

import java.util.Map;

public class CustomClaimVerifier {
    
}


//public class CustomClaimVerifier implements JwtClaimsSetVerifier {
//    @Override
//    public void verify(Map<String, Object> claims) throws InvalidTokenException {
//        final String username = (String) claims.get("user_name");
//        if ((username == null) || (username.length() == 0)) {
//            throw new InvalidTokenException("user_name claim is empty");
//        }
//    }
//}
Loading
Loading