profile
viewpoint
Alberto apellizzn Mikamai @mikamai Milan

lambrojos/keycloak-nodejs-graphql 3

WIP keycloak integration for graphql applications

paolorovella/react-native-memory 3

Memory game built with react-native

apellizzn/coniglio 1

Rabbit mq client for async microservices written in Elixir

apellizzn/lelylan-go 1

Go wrapper for Lelylan API

apellizzn/sq_2048 1

2048 game in react native

apellizzn/tree_map 1

TreeMap implementation in Typescript using Red/Black Binary Search Tree data structure

mikamai/rxp-hpp-elixir 1

Realex Hpp SKD for Elixir

apellizzn/avrora 0

A convenient Elixir library to work with Avro schemas and Confluent® Schema Registry

apellizzn/carz 0

Online car shop built with Rails API and Flux React Client

issue openedkeycloak/keycloak-nodejs-admin-client

Refactor RequiredActionAlias

We have the enum RequiredActionAlias defined as follow

export declare enum RequiredActionAlias {
    VERIFY_EMAIL = "VERIFY_EMAIL",
    UPDATE_PROFILE = "UPDATE_PROFILE",
    CONFIGURE_TOTP = "CONFIGURE_TOTP",
    UPDATE_PASSWORD = "UPDATE_PASSWORD",
    terms_and_conditions = "terms_and_conditions"
}

Since on Keycloack we have the ability to create our own custom required actions using SPI I feel this enum should be more generic otherwise we are gonna have typing issues.

What about something like this?

export declare enum StandardRequiredActionAlias {
  VERIFY_EMAIL = "VERIFY_EMAIL",
  UPDATE_PROFILE = "UPDATE_PROFILE",
  CONFIGURE_TOTP = "CONFIGURE_TOTP",
  UPDATE_PASSWORD = "UPDATE_PASSWORD",
  terms_and_conditions = "terms_and_conditions"
}

export declare type RequiredActionAlias = StandardRequiredActionAlias | string

This will allow us to do

   client.users.executeActionsEmail({
      id: "123"
      actions: ["INVITE_USER", StandardRequiredActionAlias.CONFIGURE_TOTP, ]
    })
  }

created time in a month

issue openednestjs/passport

Inject secret and algorithm after application start

[ ] Regression <!--(a behavior that used to work and stopped working in a new release)--> [ ] Bug report [x] Feature request [ ] Documentation issue or request [ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow. </code></pre>

Environment

Nest version: 7.5.1

  • Node version: v12.18.3
  • Platform: Mac

Hi, I am using nestjs passport along with passport-jwt, I have my JwtStrategy as follow

import { Injectable, UnauthorizedException } from '@nestjs/common';
import { PassportStrategy } from '@nestjs/passport';
import { ExtractJwt, Strategy } from 'passport-jwt';
import UsersService from 'src/users/users.service';


@Injectable()
export class JwtStrategy extends PassportStrategy(Strategy) {
  constructor(private userService: UsersService) {
    super({
      signOptions: {
        algorithm: "RS256"
      },
      jwtFromRequest: ExtractJwt.fromAuthHeaderAsBearerToken(),
      secretOrKey: "secret",
    });
  }

  async validate(payload: any) {
    const user = await this.userService.getOrImport(payload.sub);
    if (!user) {
      throw new UnauthorizedException();
    }

    return { user: user };
  }
}

Since I' am using Keycloak as SSO I can call a specific endpoint to retrieve my public key to validate jwts. The service in charge of doing this is my CertService.

Is it possible to inject secretOrKey and algorithm options after the application start using another resolved service ? I would like to do something like this but currently it is not possible due to the async behaviour

import { Injectable, UnauthorizedException } from '@nestjs/common';
import { PassportStrategy } from '@nestjs/passport';
import { ExtractJwt, Strategy } from 'passport-jwt';
import UsersService from 'src/users/users.service';


@Injectable()
export class JwtStrategy extends PassportStrategy(Strategy) {
  constructor(private userService: UsersService, private CertService) {
   // this wont work
   await certService.getInfoFromSSO();

    super({
      signOptions: {
        algorithm: certService.getAlg()
      },
      jwtFromRequest: ExtractJwt.fromAuthHeaderAsBearerToken(),
      secretOrKey: certService.getPublicKey(),
    });
  }
}

created time in a month

create barnchapellizzn/coniglio

branch : setup-pipeline

created branch time in 2 months

create barnchapellizzn/coniglio

branch : feature/refactoring

created branch time in 2 months

create barnchapellizzn/coniglio

branch : master

created branch time in 2 months

create barnchapellizzn/coniglio

branch : add-config

created branch time in 2 months

created repositoryapellizzn/coniglio

created time in 2 months

issue commentmholt/PapaParse

React Native issue Synchronous http requests are not supported

@rendomnet From what I remember I've just opened the node module and hardcoded IS_WORKER = false in my local since this fix was needed only for debugging pourpose

apellizzn

comment created time in 2 months

more