{"action":"created","issue":{"url":"https://api.github.com/repos/okta/okta-commons-java/issues/2","repository_url":"https://api.github.com/repos/okta/okta-commons-java","labels_url":"https://api.github.com/repos/okta/okta-commons-java/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/okta/okta-commons-java/issues/2/comments","events_url":"https://api.github.com/repos/okta/okta-commons-java/issues/2/events","html_url":"https://github.com/okta/okta-commons-java/pull/2","id":358124361,"node_id":"MDExOlB1bGxSZXF1ZXN0MjEzOTcyNTY2","number":2,"title":"Allow for simple validation without throwing an InvalidArgumentException","user":{"login":"bdemers","id":99954,"node_id":"MDQ6VXNlcjk5OTU0","avatar_url":"https://avatars2.githubusercontent.com/u/99954?v=4","gravatar_id":"","url":"https://api.github.com/users/bdemers","html_url":"https://github.com/bdemers","followers_url":"https://api.github.com/users/bdemers/followers","following_url":"https://api.github.com/users/bdemers/following{/other_user}","gists_url":"https://api.github.com/users/bdemers/gists{/gist_id}","starred_url":"https://api.github.com/users/bdemers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bdemers/subscriptions","organizations_url":"https://api.github.com/users/bdemers/orgs","repos_url":"https://api.github.com/users/bdemers/repos","events_url":"https://api.github.com/users/bdemers/events{/privacy}","received_events_url":"https://api.github.com/users/bdemers/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-09-07T15:59:53Z","updated_at":"2018-09-14T17:43:13Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/okta/okta-commons-java/pulls/2","html_url":"https://github.com/okta/okta-commons-java/pull/2","diff_url":"https://github.com/okta/okta-commons-java/pull/2.diff","patch_url":"https://github.com/okta/okta-commons-java/pull/2.patch"},"body":"This allows the ConfigurationValidator to be plugged into other frameworks such as a\r\nSpring's Validator or a custom javax validation framework\r\n\r\nSpring Validator example:\r\n\r\n```java\r\npublic class OktaOAuth2PropertiesValidator implements Validator {\r\n\r\n    @Override\r\n    public boolean supports(Class<?> clazz) {\r\n        return OktaOAuth2Properties.class.isAssignableFrom(clazz);\r\n    }\r\n\r\n    @Override\r\n    public void validate(Object target, Errors errors) {\r\n\r\n        OktaOAuth2Properties properties = (OktaOAuth2Properties) target;\r\n\r\n        ConfigurationValidator.validateHttpsUrl(properties.getIssuer()).ifInvalid(res ->\r\n            errors.rejectValue(\"issuer\", res.getMessage()));\r\n\r\n        ConfigurationValidator.validateClientId(properties.getIssuer()).ifInvalid(res ->\r\n            errors.rejectValue(\"clientId\", res.getMessage()));\r\n\r\n        ConfigurationValidator.validateClientSecret(properties.getIssuer()).ifInvalid(res ->\r\n            errors.rejectValue(\"clientSecret\", res.getMessage()));\r\n    }\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/okta/okta-commons-java/issues/comments/421433147","html_url":"https://github.com/okta/okta-commons-java/pull/2#issuecomment-421433147","issue_url":"https://api.github.com/repos/okta/okta-commons-java/issues/2","id":421433147,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMTQzMzE0Nw==","user":{"login":"bdemers","id":99954,"node_id":"MDQ6VXNlcjk5OTU0","avatar_url":"https://avatars2.githubusercontent.com/u/99954?v=4","gravatar_id":"","url":"https://api.github.com/users/bdemers","html_url":"https://github.com/bdemers","followers_url":"https://api.github.com/users/bdemers/followers","following_url":"https://api.github.com/users/bdemers/following{/other_user}","gists_url":"https://api.github.com/users/bdemers/gists{/gist_id}","starred_url":"https://api.github.com/users/bdemers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bdemers/subscriptions","organizations_url":"https://api.github.com/users/bdemers/orgs","repos_url":"https://api.github.com/users/bdemers/repos","events_url":"https://api.github.com/users/bdemers/events{/privacy}","received_events_url":"https://api.github.com/users/bdemers/received_events","type":"User","site_admin":false},"created_at":"2018-09-14T17:43:13Z","updated_at":"2018-09-14T17:43:13Z","author_association":"NONE","body":"Moving to `initial-commit` branch, i'll reference @dogeared's comments from there"}}
{"actor":{"display_login":"bdemers"}}