realm | A total rip-off of the Elm Architecture , in React | State Container library
kandi X-RAY | realm Summary
kandi X-RAY | realm Summary
A total rip-off of the Elm Architecture, in React. Realm components are React components, so they are interoperable with non-Realm components. Use Realm for your entire app, or just in specific places. One way to think of it is as "nested Redux." Each Realm component is its own mini-Redux app, which can be composed of other Redux apps. See also Realm Redux, which enables the use of Redux extensions with Realm components.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of realm
realm Key Features
realm Examples and Code Snippets
protected Collection extractAuthorities(OAuth2AuthenticatedPrincipal principal) {
//
Map> realm_access = principal.getAttribute("realm_access");
List roles = realm_access.getOrDefault("roles", Collections.emptyList
Community Discussions
Trending Discussions on realm
QUESTION
I am developing a simple blog engine in go using only the standard libraries (and the mysql driver 😁)
For the admin I am using Basic HTTP Auth
...ANSWER
Answered 2022-Apr-15 at 12:50When it comes down to storing credentials on a server or other runtime environment, you are somehow between the devil and the deep blue sea. There is no real good solution which is likewise usable.
Start asking yourself, what your threat model is.
- A: Secrets being persisted in version control, shared with others, or even worse, made public on GitHub etc.
- B: Secrets being exposed to unprivileged co-users of the runtime environment
- C: Secrets being exposed to privileged users of the runtime environment (including an attacker who compromised the system and was able to get privileged user rights).
Based on the threats defined, you can start assessing potential solutions to store and inject secrets. This will of course depend on your environment (e.g. OS, cloud provider, Kubernetes/Docker, etc.). In the following I will assume Linux as OS.
Pass in as parameter:
Would mitigate threat A, but not B and C. Command line arguments can be revealed even by unprivileged users e.g. by ps -eo args
Store in config file: Would mitigate threat B, given that file permissions are set correctly. With regard to A, there is still a risk that the config file is unintendedly added to the version control. Does not mitigate threat C.
If you would use e.g. json format for the config file, this could be implemented easily with the Golang standard lib.
Store in environment variables:
Would mitigate threats A and B, but not C. Privileged users can access the environment variables via /proc//environ
. Also the question remains how you will set the environment variables in the runtime environment. If you are using a CI/CD pipeline to deploy your service, this pipeline could be used to inject the environment variables during deployment. Usually, the CI/CD engine come with some kind of variable store for secrets.
Drawback of this approach is that the environment variables will be ephemeral, so after a reboot of the runtime environment you would need to redeploy via the CI/CD pipeline or you need to ensure persistence of the secrets in the runtime environment, e.g. in a startup script.
Environment variables can be read easily with os.Getenv()
or os.LookupEnv()
from the standard lib.
Enter manually on start time: Would mitigate A and B, but privileged users would still be able to read the secrets from memory. Upon reboot of the runtime environment, the service will not be available until an operator enters the secrets manually. So this approach would probably be considered as impractical in many use cases.
Further considerations:
Storing secrets in a database as suggested by brianmac shifts the question to "Where to store my db credentials?"
Combining secret encryption with any of the solutions described above will require that the decryption key is made available to the service in the runtime environment. So you either need a TPM-based solution or you are faced with the question, where to store this key.
"Secrets as a Service" solutions like Hashicorp Vault, Azure Key Vault, AWS Secrets Manager etc. will probably be oversized in your scenarion. They provide centralized storage and management of secrets. Applications/services can retrieve secrets from this solution via a defined API.
This, however, requires authentication and authorization of the service requesting a secret. So we are back at the question how to store another secret for the service in there runtime environment.
Cloud providers try to overcome this by assigning the runtime environment an identity and authorizing this identity to access other cloud resources including the "Secret as a Service" solution. Usually only the designated runtime environment will be able to retrieve the credentials of the identity. However, nothing can prevent an privileged user who has access the runtime environment from using the identity to access the secrets.
Bottom line is that it is hard to impossible to store secrets in a way that a privileged user or someone who compromised the system will not be able to get access.
If you accept this as the residual risk, storing the secrets in environment variables is a good approach as it can avoid persisting secrets. It is also platform agnostic and thus can be used with any runtime environment, cloud provider etc. It can also be supported by a variety of automation and deployment tools.
QUESTION
I've tried for many hours now and seem to have hit a wall. Any advice/help would be appreciated.
Goal: I want to authorize the express rest-api (ex client-id: "my-rest-api") routes (example resource: "WeatherForecast") across various HTTP methods mapped to client scopes (examples: "create"/"read"/"update"/"delete"). I want to control those permissions through policies (For example - "Read - WeatherForecast - Permission" will be granted if policy "Admin Group Only" (user belongs to admin group) is satisfied.
Rest-api will not log users in (will be done from front end talking directly to keycloak and then they will use that token to talk with rest-api).
Environment:
- Keycloak 15.1.1 running in its own container, port 8080, on docker locally (w/ shared network with rest-api)
- "my-rest-api": Nodejs 16.14.x w/ express 4.17.x server running on its own container on docker locally. Using keycloak-connect 15.1.1 and express-session 1.17.2.
- Currently hitting "my-rest-api" through postman following this guide: https://keepgrowing.in/tools/kecloak-in-docker-7-how-to-authorize-requests-via-postman/
What Happens: I can login from keycloak login page through postman and get an access token. However when I hit any endpoint that uses keycloak.protect() or keycloak.enforce() (with or without specifying resource permissions) I can't get through. In the following code the delete endpoint returns back 200 + the HTML of the keycloak login page in postman and the Get returns back 403 + "Access Denied".
Current State of Realm
- Test User (who I login with in Postman) has group "Admin".
- Client "my-rest-api" with access-type: Confidential with Authorization enabled.
- Authorization set up:
- Policy Enforcement Mode: Enforcing, Decision Strategy: Unanimous
- "WeatherForecast" resource with uri "/api/WeatherForecast" and create/read/update/delete client scopes applied.
- "Only Admins Policy" for anyone in group admin. Logic positive.
- Permission for each of the client scopes for "WeatherForecast" resource with "Only Admins Policy" selected, Decision Strategy: "Affirmative".
Current State of Nodejs Code:
...ANSWER
Answered 2022-Apr-11 at 18:17So my team finally figured it out - the resolution was a two part process:
- Followed the instructions on similar issue stackoverflow question answers such as : https://stackoverflow.com/a/51878212/5117487 Rough steps incase that link is ever broken somehow:
- Add hosts entry for 127.0.0.1 keycloak (if 'keycloak' is the name of your docker container for keycloak, I changed my docker-compose to specify container name to make it a little more fool-proof)
- Change keycloak-connect config authServerUrl setting to be: 'http://keycloak:8080/auth/' instead of 'http://localhost:8080/auth/'
- Postman OAuth 2.0 token request Auth URL and Access Token URL changed to use the now updated hosts entry:
- "http://localhost:8080/auth/realms/abra/protocol/openid-connect/auth" -> "http://keycloak:8080/auth/realms/abra/protocol/openid-connect/auth"
- "http://localhost:8080/auth/realms/abra/protocol/openid-connect/token" -> "http://keycloak:8080/auth/realms/abra/protocol/openid-connect/token"
QUESTION
There has been other questions on the subject, but nothing seems working for me.
I have a functional CURL, but I want to translate to JS (with Node).
ANSWER
Answered 2022-Feb-19 at 13:04You need to specify that it's a digest:
QUESTION
This worked fine for me be building under Java 8. Now under Java 17.01 I get this when I do mvn deploy.
mvn install works fine. I tried 3.6.3 and 3.8.4 and updated (I think) all my plugins to the newest versions.
Any ideas?
...ANSWER
Answered 2022-Feb-11 at 22:39Update: Version 1.6.9 has been released and should fix this issue! 🎉
This is actually a known bug, which is now open for quite a while: OSSRH-66257. There are two known workarounds:
1. Open ModulesAs a workaround, use --add-opens
to give the library causing the problem access to the required classes:
QUESTION
java.sql.SQLRecoverableException: IO Error: The service in process is not supported. Operation unavailable (Mechanism level: KRB_CRED not generated correctly.)
...ANSWER
Answered 2022-Feb-09 at 06:03Actually a bit more information and stacktrace would have helped in debugging the issue. As per the information provided above,
This exception
happens when there is a mismatch in the kerberos
credential
. Then GSSException occurs and this message is generated.
QUESTION
After updating Jenkins, it is sending a warning for ambiguous permission for project base permission. I can migrate the entry to user
or group
manually, was wondering if there's an automate or batch way to do so?
Warning Messages
Some permission assignments are ambiguous. It is recommended to update affected configurations to be unambiguous. See this overview page for a list of affected configurations.
...This table contains rows with ambiguous entries. This means that they apply to both users and groups of the specified name. If the current security realm does not distinguish between user names and group names unambiguously, and if users can either choose their own user name or create new groups, this configuration may allow them to obtain greater permissions. It is recommended that all ambiguous entries are replaced with ones that are either explicitly a user or group.
ANSWER
Answered 2021-Dec-29 at 23:41I have deleted old entries and added them again, warning disappeared.
QUESTION
I have problems creating subsequent records with netsuite rest api using Token Based Authentication (TBA) oauth authentication. Here is my full code: https://gist.github.com/axilaris/428e63e5ff107d212fbcc07c5bdbce7a (it contains restlet, python code and the output of the python code).
The first record get created (you could see success) but the 2nd always get INVALID_LOGIN_ATTEMPT. If I remove creating the 2nd record, it will still be successful creating each time. But if I have in a process creating 2nd or more, its always the 2nd and more will have INVALID_LOGIN_ATTEMPT.
...ANSWER
Answered 2021-Oct-31 at 22:00As per SuiteAnswer 74343
For this example, combination of nonce + timestamp was already used by the user. Make sure to generate unique nonce to every request.
Make sure to don't send the same request twice. (If the user need do the same operation, the user must generate a new TBA header).
QUESTION
New to MongoDB, very new to Atlas. I'm trying to set up a trigger such that it reads all the data from a collection named Config
. This is my attempt:
ANSWER
Answered 2021-Oct-14 at 18:04The connection has to be a connection to the primary replica set and the user log in credentials are of a admin level user (needs to have a permission of cluster admin)
QUESTION
I have a use case where I want to send the contents of a csv file to a mongoDB collection whenever the file is modified. I found that a webhook could be created in mongoDB Realm. The intention of code below is to do 2 things. First, drop a specified collection in a specified db. Second, to insert many (~10k+) documents to the specified collection.
...ANSWER
Answered 2021-Sep-22 at 17:35I have found a couple of points of interest that may help your cause. First, let me provide my solution. I used an Atlas Realm webhook with the following attributes:
- Authentication: System
- Log Function Arguments: ON
- HTTP Method: POST
- Respond With Result: ON
- Can Evaluate:
- Request Validation: No Additional Authorization
Of these items, I think the HTTP Method is the most relevant. Since you are passing data in your CURL command using the -d operator a GET method will not suffice. Your CURL command did not specify an HTTP verb so it assumes GET. The second item is request validation. I see your URL includes the special secret
key item. I am not using any validation because I am focused on having the function work as expected, then I would apply security.
Web Hook Function
QUESTION
I would like to use my Keycloak authentication for Swagger UI generated by Quarkus. This is my config in application.properties:
...ANSWER
Answered 2021-Sep-22 at 19:21All right, I found a way to make it work, albeit with the implicit flow and a dedicated second (public) client in Keycloak.
The Quarkus application.properties:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install realm
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page